[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: getting all nodes from a certain level in the xml

Subject: RE: getting all nodes from a certain level in the xml hierarchy
From: "James Fuller" <james.fuller@xxxxxxxxxx>
Date: Fri, 27 Sep 2002 10:41:42 +0100
xml find all nodes
you could look at the dir utility on www.bayes.co.uk

and u could have a matched template

<xsl:template match="Folder[count(descendant::*)=desired_node_depth]">

</xsl:template>

gl, jim fuller

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Peter Menzel
> Sent: 27 September 2002 10:14
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  getting all nodes from a certain level in the xml
> hierarchy
>
>
> Hallo
>
> my problem is the following:
> my XML document maps the structure of a folder tree (just like
> the unix file
> hierarchy) but without files, e.g.:
>
> <Folder NAME="/">
>   <Folder NAME="a"/>
>   <Folder NAME="b">
>     <Folder NAME="ba"/>
>     <Folder NAME="bb"/>
>   </Folder>
>   ...
>   <Folder NAME="z">
>     <Folder NAME="za">
> 	...
>                 <Folder NAME="very deep folder"/>
>       ...
>     </Folder>
>   </Folder
> </Folder>
>
> The real folder NAMEs are like real folder names, and have no specific
> length or content.
> The depth of the deepest node is unknown.
>
> I need to access all nodes that have the same depth.
> So first i need root, then all direct childs of root, then all nodes that
> are two levels under root, because i want tu put them in a table like:
>
> level | 0 |  1  |  2   ...         x
> ------+---+-----+------     ---------------
>       | / |  a  |  ba       very deep folder
>       |   |  b  |  bb
>             ...
>       |   |  z  |  za
>
> first I started to try <xsl:for-each select="//Folder"> and then
> <xsl:for-each select="//Folder/Folder"> but because I do not know
> the depth
> of the tree, this won't work..
>
> Can anybody help me, what is the direction i should go?
> I don't think there is an easy way to use XPath for adressing nodes on the
> same level?
>
> Nice greetings, Peter
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.