match uncaught though declared in XSL
Posted: Thu Dec 04, 2014 4:44 pm
I've the below XML.
and when i run the below XSLT.
When i run this, instead of printing <div class="para">18</div>, it is printing <div class="para"></div>
please let me know where am i going wrong and how can i fix this.
Thanks
Code: Select all
<para indent="no">
<star.page>18</star.page> Further to same.
</para>
Code: Select all
<xsl:template match="para">
<xsl:value-of select="./node()[1][self::star.page]|./label/node()[1][self::star.page]"/>
<div>
<xsl:choose>
<xsl:when test="./@align">
<xsl:attribute name="class"><xsl:text>para align-</xsl:text><xsl:value-of select="./@align"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class"><xsl:text>para</xsl:text></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</div>
</xsl:template>
please let me know where am i going wrong and how can i fix this.
Thanks