This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Collecting attributes from the ancestor-or-self axis
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 16 Nov 2001 15:29:52 GMT
- Subject: Re: [xsl] Collecting attributes from the ancestor-or-self axis
- References: <a05100312b81ad4bffeaf@[63.215.152.58]>
- Reply-to: xsl-list at lists dot mulberrytech dot com
>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
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list