[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
Re: Xsl:strip-space and xsl:preserve-space (XSLT 2.0)
Subject: Re: Xsl:strip-space and xsl:preserve-space (XSLT 2.0)|
From: Evan Lenz <evan@xxxxxxxxxxxx>
Date: Wed, 24 Sep 2008 09:54:50 -0700
On second thought, your original stylesheet will have to change, because
<xsl:strip-space/> won't strip whitespace-only text nodes that have been
force-preserved using xml:space="preserve" (which will be true for all
whitespace in your document if you put that at the root element).
Instead of using <xsl:strip-space/> (and <xsl:preserve-space/>), you
could use a template rule that processes whitespace-only text nodes that
are not children of <element1> or <element2>:
<xsl:template match="*[not(self::element1 or
The rule is empty and thus has the effect of "stripping" them from the
Let me know if that works. :-)
Evan Lenz wrote:
You can force MSXML to preserve whitespace by adding
xml:space="preserve" to the root element of your document. Then your
original stylesheet should work as desired. Let me know if that works.
Pankaj Chaturvedi wrote:
Not a good news for me.
Well anyways David/Michael thanks for looking into this.
From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Wednesday,
September 24, 2008 6:36 PM
Subject: RE: Xsl:strip-space and xsl:preserve-space (XSLT 2.0)
I believe it's true that the AltovaXML processor always strips
nodes (or calls the MSXML parser in a way that strips them) and I'm not
aware of any way of changing this.
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