I need to find out if there is something between the two nodes. My XML looks like this:
<event value1="1" value2="2" value3="3" info="some info here">
Line 1.<lb/>
Line 2.<lb/><lb/>
Line 3.<lb/>
Line 4.<lb/>
</event>
My goal is to convert nodes <lb/>to <br/>HTML tags using XSLT. However, there is one more requirement. In case there is one <lb/> immediately following the other <lb/>, I want to output only one <br/> .
My XSLT looks like this:
<xsl:template match="lb">
<xsl:if test="not(preceding-sibling::lb[1])">
<br/>
</xsl:if>
</xsl:template>
The problem with the above XSLT is that it only works correctly for line 1 if the text between the two nodes is ignored.
Maybe someone here can help.
source
share