[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Copying into additional attributes from a differen

Subject: Re: Copying into additional attributes from a different part of thetree
From: David_Marston@xxxxxxxxx
Date: Tue, 31 Jul 2001 15:57:35 -0400
Re:  Copying into additional attributes from a differen
The Invisible Stylesheeter writes:
>The transformation process is as follows:
>1. Copy all nodes and attributes of B's descendants
>   {in this case, C and D}
>...
>2. Look for the NAME attribute in children of E/F and copy the
>corresponding values of class and method names into attributes and add
>it to the above tree: The result will be:
> <AA>
>   <C id="1" name="CC" class="foo" method="test">
>     <D id="2" name="DD" class="foo1" method="test1" />
>   </C>
>  </AA>
>I used the <xsl:copy-of> to do step 1...How can I do step 2?

Since step 2 turns this into the expand-structure-as-I-copy-it
scenario, you have to go back and re-do step 1 with xsl:copy, then
jump in with xsl:attribute at the appropriate places to add in the
extra attributes. I believe that the FAQ has some examples of
copying everything while adding extra stuff. Attributes are subject
to rules about when they can be added: after (so to speak) namespace
nodes but before text, comments, PIs, and child elements.
.................David Marston


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.