xsl-list
[Top] [All Lists]

RE: possible nested loops

2006-02-14 17:16:21
It sounds like a straightforward beginner's problem, but it's hard to know
how to set you on the right path without seeing where you've gone wrong. I
know you may find it embarrassing to show your novice code in public, but
it's the best way of getting focussed advice.

Nested for-each loops are one way to tackle this problem, but "the XSLT way"
is a recursive descent of the tree structure using template rules that match
the nodes at each level.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: garry(_at_)skegnessgrammar(_dot_)org 
[mailto:garry(_at_)skegnessgrammar(_dot_)org] 
Sent: 14 February 2006 22:21
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] possible nested loops

I wonder if someone could point me in the right direction to solve my
problem. I need to transform an xml file to html. I have 
tried to make a
stylesheet but none of my efforts have been successful.
The xml has around 800 pupil records (<pupil>) so I want to 
iterate over
each pupil node. Within each pupil node there are other nodes which
repeat, so for each pupil I need to iterate over child nodes of which
there may be none or many of each type. I suspect a nested 
loop of some
sort may help but I have not been able to implement one, any ideas?
regards
garry


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>