[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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/
|
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
|