test for an empty result tree fragment

Discussion in 'XML' started by Andy Fish, Feb 8, 2007.

  1. Andy Fish

    Andy Fish Guest

    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
    Andy Fish, Feb 8, 2007
    #1
    1. Advertising

  2. In article <QtGyh.7854$>,
    Andy Fish <> wrote:

    >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
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
    Richard Tobin, Feb 8, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DU
    Replies:
    9
    Views:
    7,097
  2. Roman O

    Url.Fragment property is empty

    Roman O, May 10, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    547
  3. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,111
  4. Rajarshi
    Replies:
    1
    Views:
    536
    Gabriel Genellina
    Feb 11, 2007
  5. Michael Tan
    Replies:
    32
    Views:
    969
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page