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. Advertisements

  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. Advertisements

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,432
  2. Roman O

    Url.Fragment property is empty

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

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,598
  4. Rajarshi
    Replies:
    1
    Views:
    634
    Gabriel Genellina
    Feb 11, 2007
  5. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    1,036
    Skybuck Flying
    Oct 4, 2009
  6. Jongware

    Tree fragment between two tags?

    Jongware, Jun 7, 2010, in forum: XML
    Replies:
    2
    Views:
    1,266
    Jongware
    Jun 7, 2010
  7. Terry V

    add html fragment (and controls) to control tree

    Terry V, Aug 25, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    1,125
    Terry V
    Aug 25, 2004
  8. Michael Tan
    Replies:
    32
    Views:
    1,583
    Ara.T.Howard
    Jul 21, 2005
Loading...