Could you please give me a bit of details as to what you're trying to achieve? I am a bit confused because, in a macro, you'll only ever have 1 element (the image you're pointing to). As such, the only test case being hit is the one where your position = 1.
Position Problem Inside Macro / Macro Container
Hi, Im having some issues with applying a css class based on position within a macro.
I am also using this macro with a macro container.
My html output is only applying the first position class.
Any help would be grateful
Thanks
Martin
Ive also tried this approach, but it still output only the "alpha" class
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:attribute name="class">alpha</xsl:attribute>
</xsl:when>
<xsl:when test="position() = last()">
<xsl:attribute name="class">omega</xsl:attribute>
</xsl:when>
</xsl:choose>
Ur template match="/" is the root node, and there is only a node at position() = 1
with jquery
$(".alpha:last").removeClass('alpha').addClass('omega');
/J
Thanks Jacob,
Im new to xslt & relunctant to use jquery.
yes, but ur macro only shows one item at the time, so its kinda hard to know when its the last without a parameter more.
/J
Hi Martin,
Could you please give me a bit of details as to what you're trying to achieve? I am a bit confused because, in a macro, you'll only ever have 1 element (the image you're pointing to). As such, the only test case being hit is the one where your position = 1.
is working on a reply...