This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Traversing a XML tree multiple times
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Traversing a XML tree multiple times
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- Date: Sun, 30 Sep 2001 18:58:11 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
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@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
> Jeroen Benckhuijsen
> Sent: 30 September 2001 17:54
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] 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