RE: Copying and Transforming/Recursion? - Revisited
David, It's obvious I am not grasping a fundamental point on XSL here - all my work up to this point has been XSL expressly specifying the output while using the XML for logic control (you can see from that sentence that I'm still grappling with the idea of template based programming). I fully understand your "input" template - but I don't understand your sentence prior: >All you need do is copy that code and add one additional template that matches "input" If my XSL actually copies the source, then how can it also apply the "input" template to the source it just copied? It seems I can do one or the other but not both - again, this makes me think of recursion (copy, apply, copy, apply... until all source is exhausted). You and others make this sound trivial to the point that I must just not be grasping a fundamental... I hate to beg a complete solution - but could you turn the above quoted sentence into a code example? Again - much appreciation in advance - cheers, Jeff -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Wednesday, October 11, 2000 7:49 PM To: xsl-list@xxxxxxxxxxxxxxxx Subject: Re: Copying and Transforming/Recursion? - Revisited > It seems to me that the author's document needs to be copied - element for > element (via recursion?) - copying element for element doesn't need explicit recursion (of a named template) just the implicit recursion inherent in apply-templates. The example code is in the XSLT spec. All you need do is copy that code and add one additional template that matches "input" <xsl:template match="input" > <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="value"> <xsl:value-of select="//submittedValue[@fieldname=current()/@fieldname"/> </xsl:attribute> </xsl:copy> (untested) </xsl:template> David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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