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

RE: Collecting attributes from the ancestor-or-self ax

Subject: RE: Collecting attributes from the ancestor-or-self axis
From: "WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)" <adam_watkin-jones@xxxxxx>
Date: Mon, 19 Nov 2001 11:38:39 -0000
adam ax
Thanks David,

Wow, that saves a lot of typing!

I believe this works as follows:
1. the select in copy-of returns a node-set in document order.  At this
point the node set has duplicate attribute names.
2. when copy-of applies these attributes to the output element, the
duplication is removed by succeeding attribute nodes overwriting the values
of any attributes that are already present.

This all seems awfully convenient!  (But I'm not complaining :)

Regards,
Adam


> From: David Carlisle
> 
> >I am trying to write some XSLT to do the following:
> >
> >1. start at element E
> >2. add all its attributes to the output
> >3. move to E's parent, EP
> >4. add to the output all those attributes
> >   of EP that do not have the same name as
> >   as an attribute already added to the output
> >5. move to EP's parent and so on collecting
> >   new attributes until I've reached the last
> >   ancestor of P.
> 
> this is a ___lot___ easier than you think:-)
> 
> <xsl:copy-of select="ancestor-or-self::*/@*"/>
> 
> does exactly that.
> 
> David
> 

 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.