Re: [xsl] Result still indented despite indent="no"

Subject: Re: [xsl] Result still indented despite indent="no"
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Feb 2005 23:07:37 -0500
At 2005-02-19 19:02 -0800, Sebastien Boisvert wrote:
I'm getting a result after applying a stylesheet where
some nodes get indented for some reason, even if I set
indent="no" and even the source document is not
indented.

It seems that calling a certain template when
processing the root node somehow sets the indent mode
to 'yes' but only for that one template, as running
the default template (ie <xsl:apply-templates />) does
not produce this problem...

Good sleuthing there... well done ... that points to interpretation of the stylesheet into a node tree.


I've tried this on another processor with the exact
same stylesheet and source code and it works as
expected (indents do not happen).

Ahhh .. that points to a bug ... unless of course you used the MSXSL processor for your alternate test in which it isn't at all definitive because the Microsoft processor throws away whitespace-only text nodes contrary to the explicit specification rules[1]. If you used a processor conformant in the area of whitespace handling, then the test is more meaningful.


Is there something/someway that I might be calling the
template that would cause it to produce indents in
libxslt?

Do you have xml:space="preserve" used anywhere? That overrides the rules regarding ignoring whitespace-only text nodes from the stylesheet node tree when building the result tree and would make any such annotated nodes visible.


I hope this helps.

...................... Ken


[1] - excerpts from an online debate regarding this issue of handling whitespace-only text nodes, July 2003:


Microsoft's question:

http://lists.xml.org/archives/xml-dev/200307/msg00868.html

Microsoft's answer (by another employee):

http://lists.xml.org/archives/xml-dev/200307/msg00872.html

My claim where I observe Microsoft's non-compliance:

http://lists.xml.org/archives/xml-dev/200307/msg00870.html

Microsoft's counter-claim:

http://lists.xml.org/archives/xml-dev/200307/msg00873.html

My response:

http://lists.xml.org/archives/xml-dev/200307/msg00880.html

Microsoft's position at the end of the debate:

http://lists.xml.org/archives/xml-dev/200307/msg00885.html

I haven't heard anything official since, but as far as I know, this whitespace-handling behaviour has not changed.


-- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread