|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Need help combing two elements
Fatbob:
Input: <data> <one a="1"/> <two b="2"/> </data> XSLT: <xsl:template match="data">
<both a="{one/@a}" b="{two/@b}"/>
</xsl:template>Output: <both a="1" b="2"/> Or more generally: decide on a context from which all the necessary data components for your new element are visible (any context will do but some are easier than others), and make the new element, pulling in whatever data you want from wherever you find it. In fact, it's pretty hard to write XSLT that doesn't do this, in a very general way. If you think in terms of elements and attributes being nodes on a tree, rather than stuff written with tags (as you really must to get anywhere with XSLT), it starts seeming very normal. Cheers, Wendell At 02:11 PM 3/27/2009, you wrote: Thanks for taking the time to write that email. Greatly appreciate it.
|
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
|






