XSLT empty tags are not included in output



I am transforming an XML to another format. Input XML include table which have empty cells. Input is:



<cals:tbody>
<cals:row>
<ce:entry>
<ce:italic>P. andensis</ce:italic> Vitik.
</ce:entry>
<ce:entry/>
<ce:entry>+</ce:entry>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry>+</ce:entry>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry align="char" char=".">2</ce:entry>
<ce:entry align="char" char=".">1</ce:entry>
<ce:entry align="char" char=".">1</ce:entry>
</cals:row>
<cals:row>
<ce:entry>
<ce:italic>P. aphthosa</ce:italic> (L.) Willd.
</ce:entry>
<ce:entry>+</ce:entry>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry/>
<ce:entry>+</ce:entry>
<ce:entry/>
<ce:entry>+</ce:entry>
<ce:entry>+</ce:entry>
<ce:entry/>
<ce:entry/>
<ce:entry align="char" char=".">41</ce:entry>
<ce:entry align="char" char=".">8</ce:entry>
<ce:entry align="char" char=".">3</ce:entry>
</cals:row>
</cals:tbody>


my xslt code is :



<xsl:for-each select="/TBODY/ROW">

<tr>
<xsl:for-each select="./ENTRY">

<xsl:element name="td">
<xsl:value-of select="."></xsl:value-of>
</xsl:element>

</xsl:for-each>
</tr>
</xsl:when>
</xsl:choose>

</xsl:for-each>


Output do not have td tags for corresponding empty entry tag. Is there any solution for this problem?


No comments:

Post a Comment