This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Copying into additional attributes from a different part of thetree



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]