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

Re: The identity transform and attributes

Subject: Re: The identity transform and attributes
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 21 Jan 2008 11:34:34 +0000
Re:  The identity transform and attributes
Mike:
> <xsl:template match="element()">
>     <xsl:copy>
>         <xsl:apply-templates select="@*,node()"/>
>     </xsl:copy>
> </xsl:template>
...
> (The "," in place of "|" is a minor optimization that recent Saxon releases
> do anyway - it avoids an unnecessary merge/deduplication of the sequence of
> attributes with the sequence of children.)

Nice - a definite change for the 2.0 version.


Abel:
> Btw, it is never possible to override the text() of an attribute. An
> attribute does not have children.

Indeed, I probably should repeat that to myself a few times.  It's an
odd concept to me for some reason... Why shouldn't an attribute node
have a child text node?  I guess it's because it's not needed due the
limited content allowed for an attribute?... or for historical
reasons?... or perhaps some fundamental markup principle that I'm
unaware of after all this time :)

It's certainly not intuitive that when you what to just change the
attribute's value you have to create a new attribute node - something
that's not helped by the usual indentity template.


cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.