xsl problem

wxdqz

New Member
I hope im posting in the right place.
Anyway i got a problem to write xsl that builds a table from xml.
The problem is: that i need that if the xml have an empty tag, i want   or to be there.

Here is my xml:


<Rows>
<Row>
<A>a</A>
<B>b</B>
</Row>
<Row>
<A>a</A>
<B></B>
</Row>
</Rows>


Note the empty b tag.
now here is the xsl i tried an dit wont work for the spaces:

<xsl:template match="/Rows">
<table>
<xsl:for-each select="Row">
<tr>
<xsl:for-each select="*">
<td class="ListCell">
<xsl:if test="text() = ''">
<xsl:text>this is space!!!! i want it to apear in the table</xsl:text>
</xsl:if>
<xsl:if test="text() != ''">
<xsl:value-of select="text()"/>
</xsl:if>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</xsl:template>

Thanks
 
Back
Top