[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: mixing recursive template calls and for-each
> > Here his an example of the template i could manage to write... > > <xsl:template match="place:list-of"> > <!-- the node to iterate on --> > <xsl:variable name="node" select="@node" /> > <!-- the nodes which are not under source node, that > will be copied --> > <xsl:variable name="present" > select=".//*[not( ancestor-or-self::source)]" /> > <!-- iterate on workitems --> > <xsl:for-each select="source//*[name() = $node]"> > <!-- keep info on the current workitem --> > <xsl:variable name="currentWI" select="xalan:nodeset(.)" /> > <!-- go through the nodes to treat --> > <xsl:for-each select="$present"> > <xsl:choose> ... > > Here is my problem, for each given node under <source>, i > would like > to generate the tags inside place:list-of and at the same time change > place:value-of for the corresponding value. > > Of course, <place:list-of> is intended to be generic and > should work > for any tags under <source> and i don't know at what depth i > will find > <place:value-of> tags... > First principle: if you want to write XSLT code that can handle variability of structure, don't use <xsl:for-each>, use template rules and <xsl:apply-templates/>. I'm afraid I haven't had time to look at your particular problem in depth. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|