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

Whitespace,xml:space,xsl:strip-space

Subject: Whitespace,xml:space,xsl:strip-space
From: Paul_Martin@xxxxxxxxxxxxxx
Date: Fri, 23 Jun 2000 19:15:08 +1000
whitespace xml
I am a bit  confused by whitespace handling, so I apologise for the detailed queries.
Thanks very much in advance.

Am I correct in saying that :-

1. the default parser behaviour (ie. when have not set the parser NOT to include whitespace or overidden ignorableWhitespace with a noop) is for all whitespace, ie. leading and trailing whitespace, and also carriage returns etc. to be passed to the application. The latter becoming whitespace-only text nodes.

2. the effect of xml:space on whitespace-only text nodes produced by the parser is that when xml:space ="preserve" then the IsIgnorableWhitespace() method of these whitespace-only text nodes will return false indicating that they should not be discarded by the application; and when xml:space="default" then the method will return false indicating that can be discarded by the aqpplication.

3. the xml:space attribute has no effect on leading or trailing whitespace, eg.
<schedule>
<scheduleNumber xml:space="default">    123456789</scheduleNumber>
</schedule>
and
<xsl:template match="schedule" >
<fo:block><xsl:value-of select="scheduleNumber"/></fo:block>

generates the following in the output file (note with no explicit setting of xsl:strip-space or xsl:preserve-space) :-
<fo:block>     123456789</fo:block>

4. xsl:strip-space can be used to strip leading and trailing whitespace in a text node, but will not affect the white space ONLY text nodes.

5. Could someone please provide an example(s) of the above, including where
exactly to put the xsl:strip-space and xsl:preserve elements.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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