- Joined
- Aug 2, 2006
- Messages
- 1
- Reaction score
- 0
I have the following XSL snippet:
<xsl:template match="change">
<span class="change"><xsl:attribute name="title">Change <xsl:value-of select="@chgno" />
<xsl:if test="following-sibling::strike[1]">
Previous text: <xsl:value-of select="following-sibling::strike" />
</xsl:if>
</xsl:attribute><span style="color:#666666;">'</span><span style="position: absolute; top: auto; right:1.1em; color:#660000; font-weight:bolder;">l</span><xsl:apply-templates /><span style="position: absolute; top: auto; right:1.1em; color:#660000; font-weight:bolder;">l</span><span style="color:#666666;">'</span></span>
</xsl:template>
Givent the following XML snippet:
<para>...companies serve approximately <change chgno="2">4 million customers</change> through direct insurance operations in Germany, <change chgno="2">Paraguay</change> <strike>Paragay</strike>, Peru, China, Poland, Mexico, India...<para>
I want to only display a title when the next immediate sibling is the strike element. This code will display title the same for both the first change and the second change element in the snippet above. What am I doing wrong?
<xsl:template match="change">
<span class="change"><xsl:attribute name="title">Change <xsl:value-of select="@chgno" />
<xsl:if test="following-sibling::strike[1]">
Previous text: <xsl:value-of select="following-sibling::strike" />
</xsl:if>
</xsl:attribute><span style="color:#666666;">'</span><span style="position: absolute; top: auto; right:1.1em; color:#660000; font-weight:bolder;">l</span><xsl:apply-templates /><span style="position: absolute; top: auto; right:1.1em; color:#660000; font-weight:bolder;">l</span><span style="color:#666666;">'</span></span>
</xsl:template>
Givent the following XML snippet:
<para>...companies serve approximately <change chgno="2">4 million customers</change> through direct insurance operations in Germany, <change chgno="2">Paraguay</change> <strike>Paragay</strike>, Peru, China, Poland, Mexico, India...<para>
I want to only display a title when the next immediate sibling is the strike element. This code will display title the same for both the first change and the second change element in the snippet above. What am I doing wrong?