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

RE: XSLT2.0 compatibility

Subject: RE: XSLT2.0 compatibility
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 5 Sep 2006 17:59:38 +0100
xslt2.0 examples
> "Error at xsl:copy-of on line 13 of
> file:///C:/trex-dev/Trunk/Projects/BFW/bde.bfw.core/resources/
> trans3.xsl
> t:
>   XTDE0410: An attribute node (name) cannot be created after 
> the children of the containing element
> ** Transformation error"
> 
> 
> If I remove xml:space="preserve", everything is fine. Can you 
> tell me what's wrong?
> 

If you use xml:space="preserve" (either in the stylesheet or the source
document) then it's very easy unwittingly to copy a whitespace text node to
the result document before creating an attribute. For example

<x xml:space="preserve">
  <xsl:attribute name="x"/>
</x>

creates an element X with four nodes in its content sequence: an attribute
called xml:space, a whitespace text node, an attribute called x, and another
whitespace text node.

I can't think of any good reason to use xml:space="preserve" in a
stylesheet.

Michael Kay
http://www.saxonica.com/

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-2007 All Rights Reserved.