[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Copying into additional attributes from a different pa
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...
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
|