xsl-list
[Top] [All Lists]

Re: outputting unknown amount of child elements

2004-02-09 05:27:15
Thanks for the reply.

I should have stressed that not only do I want to ouput all the elements using recursion but I also want, effectively to know how many ancestors they each have in order to structure the output so it makes clear the hierarchical structure of the data.

Many thanks

David

cknell(_at_)onebox(_dot_)com wrote:

This is what recursion is for. In your template that matches "item" output the value of the first text node "text()[1]", then apply-templates again. That will call the "item" template again. Your transformer will automatically stop processing when the source document runs out of "item" elements.



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