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

RE: Traversing a XML tree multiple times

Subject: RE: Traversing a XML tree multiple times
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Sun, 30 Sep 2001 18:58:11 +0100
traversing xml tree
Jeroen,
I'm not sure exactly what you want to do without a specific example but
you can easily transform the same tree multiple times. Say the top level
element of your xml is "root"
    <xsl:apply-templates select="/root" />
    ...do something
    <xsl:apply-templates select="/root" />
You said you want to make a different selection the second time
    <xsl:apply-templates select="/root/*[some predicate]" />
    ...do something
    <xsl:apply-templates select="/root/*[some other predicate]" />
You can also use modes
    <xsl:apply-templates select="/root" />
    ...do something
    <xsl:apply-templates select="/root" mode="createIndex">
So that only templates with the createIndex mode attribute are selected.
The posibilities are many.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Jeroen Benckhuijsen
> Sent: 30 September 2001 17:54
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Traversing a XML tree multiple times
> 
> 
> Hi,
> 
> I've been playing around with XML and XSLT lately and i 
> really don't have any clue how to solve this problem. I want 
> to transform an XML document using XSL. However i nedd to 
> traverse the tree multiple times. The first time i want to 
> make a selection, the second a different selection (based on 
> the results of the first selection), etc. Is this possible in 
> 1 xsl document?
> 
> TIA
> 
> -- 
> Jeroen Benckhuijsen
> 
> Software Engineer
> Phoenix Software
> 
>  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-2011 All Rights Reserved.