xsl-list
[Top] [All Lists]

RE: [xsl] XSLT2.0 compatibility

2006-09-05 09:55:59
How should I preserve the space of the xml for human reading? I found
indent="yes" is not good enough. I have to run prttey-print command in
xml spy edit environment to see a good indent xml file.

-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk] 
Sent: Tuesday, September 05, 2006 9:45 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] XSLT2.0 compatibility


I do follow the pattern of creating parent node and attributes first
and
creating child nodes next.

No. Before copying the attribute nodes you generate a child text node
with (a couple of newlines and a couple of tab characters)

  <xsl:template match="boot_object"
xml:space="preserve">SSSSSS<advanced_boot_object>SS<!-- The error line
is below-->SS<xsl:copy-of select="@*"/>

Normally the indentation in the stylesheet is ignored but you have asked
for it to be preserved (and copied to the output) by using xml:space and
so all those "S" (really whitespace characters) make text nodes.

You almost never want to use  xml:space="preserve" on an xsl namespace
element.

David


--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>
--~--