test for an empty result tree fragment

A

Andy Fish

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
 
R

Richard Tobin

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top