Here’s xml example:
<a>
<b>Text</b>
<b>Text</b>
<b>Text</b>
<page/>
<b>Text</b>
<b>Text</b>
<page/>
<b>Text</b>
<b>Text</b>
<b>Text</b>
<b>Text</b>
</a>
And here is html I want to achieve:
<p>Text Text Text</p>
<p>Text Text</p>
<p>Text Text Text Text</p>
It’s first time I’m using XSL so please, forgive me.
Right now I’m using this loop:
<xsl:for-each select="a/*">
<p>
<xsl:value-of select="."/>
<xsl:if test="UNKNOWN_TEST">
</p>
</xsl:if>
</xsl:for-each>
My question is, what do I need to type instead of UNKNOWN_TEST here? Or maybe that’s not they way I should try to work it out?
You can’t see if it’s self-closed, you can test if it’s empty, it won’t work anyway, because your
xslis not well-formed.Possible (not really pleasing) solution: