test for an empty result tree fragment

Andy Fish

Usenet Archive
Joined
Dec 30, 2002
Messages
605
Reaction score
0
Hi,

using XSLT 1.0, consider something like this:

<xsl: variable name="foo">
<apply-templates select="..." mode="..." />
</xsl:variable>
<xsl:if test="$foo">
do something in here
</xsl:if>

here the test always returns true because even an empty RTF has one node. how can i tell if it has any children(assuming none of the children might be a text node)?

Andy
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
Andy Fish said:
here the test always returns true because even an empty RTF has one node. how can i tell if it has any children(assuming none of the children might be a text node)?

I think you can't without using an extension function such as exslt:node-set.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,246
Members
248,133
Latest member
DujonT

Latest Threads

Top