xsl-list
[Top] [All Lists]

[xsl] How do I check to see if any of my descendants contain a certain value?

2007-08-03 06:04:36
I am trying to check me XML to see if any of the descendants contain a
certian value.

The XML is:

<root>

<type>

<id>5</id>
<inUse>0</inUse>

<childTypes>
<key>1</key>
<value>
<type>
<id>6</id>
   <inUse>1</inUse>
    <childTypes>
         <key>4</key>
          <value>
                 ......
          </value>
    </childTypes>

</type>
</value>
</childTypes>

</type>

</root>

I can have unlimited Child Types in each type.  When I get to a
certain type, I want to check and see if this node or any descendants
of this node has a value of 0 for the inUse node.

This is what I tried but it did not work:

 <xsl:if test="descendant-or-self::inUse = 0">


  </xsl:if>

Is there any way to do this?

Thank you,

Rich

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>