Hi,
I'm very new to XSL and I'm having some problems.
The XML I'm using has some tags like <Example/>
.
in my XSL (the output is HTML) I used something like this for tags without data:
<xsl:if test="count(ContractNr) > 0">
<td>Nr:</td>
<td><xsl:value-of select="ContractNr"/></td>
</xsl:if>
It works great when there is no tag.
but how do I make an <xsl:if>
for something like <ContractNumber/>
?
Ty, and sorry for my english.
UPDATE: edited my 1 post, sorry.. what I meant was that my example works when the tag I test is not present in xml, but how do i test if the tag is "empty" like or
ty, Treemonkey, but I'm not sure if this is the solution I'm looking for.
I will try to explain better.
in the xml input file there are many tags that are "optional" or "minOccurs="0"" (according to schema). using xsl I try to make a html output with a table where I use <xsl:if>
to determine if the tag is present in xml or not (no tag=no column).
I give static names to my html table columns(data in xml can not be used for nameing) and put the data from xml there. Now when the tag is <smthng/>
I still get the column with the given static name - and that is the problem. I would like to make an xsl:if
so that if there is a <smthng/>
the column is not made:
<table>
<tr><xsl:if ...>
<td>Some name:</td>
<td><xsl:value-of select="smthng"/></td></xsl:if>
</tr>
</table>