xsl-list
[Top] [All Lists]

RE: [xsl] XSLT2.0 compatibility

2006-09-05 09:59:57

"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/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>