XSLT Question - How do I select the node set I want

Norman Samuelson <[email protected]> Wed, 28 May 2003 11:29:27 -0700
Newsgroups gmane.comp.java.sun.xml.general
Message-ID <[email protected]>
I have an XML file that controls a GUI interface.  The structure is
something like this:

<elementList>
    <frame name="xyzzy">
       <tab>
         <component name="foo"/>
         <component name="bar"/>
         <box>
            <component name="baz"/>
         </box>
         <box name="gorp">
            <component name="fred"/>
         </box>
       </tab>
       <tab>
          more of the same
       </tab>
     </frame>
</elementList>

tab elements are optional, so sometimes components and boxes are direct
descendents of frame.

I need to make one nodeset that includes all of the following children of a
chosen frame:
   I want all components that are direct descendents of the frame (they
have no children)
   I want all boxes whose name is given (and none of their children).
   I want all components that are direct descendents of boxes whose name is
NOT given.

Assume I am in a template that matches the frame.

I want to say <xsl:apply-templates select="???"> <xsl:sort select="@name"/>
</xsl:apply-templates>

My question then is how do I form the node set expression for the select.

Thanks in advance for any help you can give me.


- Norm -

There are only 10 types of people in this world: those who understand
binary and those who don't.

-----------------------------------------------------
xml-interest: A list for discussing XML technologies in the Java Platform.
To post, mailto:[email protected]
Archives at: http://archives.java.sun.com/xml-interest.html
To unsubscribe, mailto:[email protected] the following message;
signoff xml-interest.