M
Matt
How can XSL detect empty elements, for example, <author></author> or
<author/> ??
The XML structure can be
<book>
<author></author>
<title></title>
</book>
The XSL has the following
<UL>
<LI>book author: <xsl:value-of
select="/book/author"></xsl:value-of></LI>
<LI>book title: <xsl:value-of
select="/book/title"></xsl:value-of></LI>
</UL>
The problem is it will display book author: and book title: even
<author> and <title>
are empty elements.
I tried the following approaches, but still not work.
<xsl:if test="string-length("<xsl:value-of select="author" />") >
0">
<xsl:count(<xsl:value-of select="author" />)></xsl:count>
any ideas? please advise. thanks!!
<author/> ??
The XML structure can be
<book>
<author></author>
<title></title>
</book>
The XSL has the following
<UL>
<LI>book author: <xsl:value-of
select="/book/author"></xsl:value-of></LI>
<LI>book title: <xsl:value-of
select="/book/title"></xsl:value-of></LI>
</UL>
The problem is it will display book author: and book title: even
<author> and <title>
are empty elements.
I tried the following approaches, but still not work.
<xsl:if test="string-length("<xsl:value-of select="author" />") >
0">
<xsl:count(<xsl:value-of select="author" />)></xsl:count>
any ideas? please advise. thanks!!