Is it possible to add recursion to an XSL template
1 posts in topic
Flat View  Flat View

Posted By:   Gerardo_Mongelli
Posted On:   Friday, May 18, 2001 08:11 AM

How can an XSL template call itself?

I´m about to generate a plain text file from a variable XML source by using XSL. The problem is that every time the transform would take place, the XSL doesn´t know what the tree structure of the XML is.
The only aproach I thought of was to add recursion by making the XSL browse the tree for children nodes and, for each one found call itself again and so on.

Something like this:

has child

Can anyone give me a hand?

Re: Is it possible to add recursion to an XSL template

Posted By:   Chris_Leonardi  
Posted On:   Monday, May 21, 2001 08:06 PM


I'd suggest looking at calling named templates; most of the recursion approaches I've encountered employ this technique.
Look at http://www.dpawson.co.uk/xsl/recursion.html for some good examples. Hope that helps,

About | Sitemap | Contact