[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: deep copy without attributes
> Well I'm not going to get hung up on that semantic - after all copy > doesn't copy and as for copy of - well what does that mean. I agree it's not easy - 'what is the difference between xsl:copy and xsl:copy-of?' is an interview question I use. Once you can visualise the input xml as a tree of nodes in your mind it's becomes straightforward, especially with attributes and their values as a single node (you can't shallow copy an attribute and change its value). A shallow copy (xsl:copy) copies a single node to the result (and just that node) while a deep copy (xsl:copy-of) copies the whole subtree. >> Instead you have to shallow copy a node at a time, and not copy the >> attribute nodes, eg use an identity template with a no-op for >> attribute: >> > > and that is what is cumbersome especially if you put yourself in the > shoes of what a good friend of mine calls an occasional dabbler in the > language. Lots of xslt is non-intuitive, but that doesn't mean it's cumbersome... try doing the same task in any other language. -- Andrew Welch http://andrewjwelch.com
|
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
|