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

Copying into additional attributes from a different pa

Subject: Copying into additional attributes from a different part of the tree
From: "john smith" <john_smith73@xxxxxxxxxxx>
Date: Tue, 31 Jul 2001 16:01:35 +0000
additional attributes for kids

Given:


<A>
 <B>
   <C id="1" name="CC">
     <D id="2" name="DD"/>
   </C>
 </B>
 <E>
   <F>
     <class>foo</class>
     <NAME>C</NAME>
   </F>
   <F>
     <method>test</method>
     <NAME>C</NAME>
   </F>
   <F>
     <class>foo1</class>
     <NAME>D</NAME>
   </F>
   <F>
     <method>test1</method>
     <NAME>D</NAME>
   </F>
 </E>
</A>


into:


<AA>
   <C id="1" name="CC" class="foo" method="test">
     <D id="2" name="DD" class="foo1" method="test1" />
   </C>
</AA>

The transformation process is as follows:

1. Copy all nodes and attributes of B's descendants
  {in this case, C and D}
  --> At this stage, this is what my result tree will look like:
<AA>
   <C id="1" name="CC">
     <D id="2" name="DD"/>
   </C>
</AA>

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?

Thanks a lot for the help...


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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.