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

RE: Handling of significant whitespace in .NET XmlReader


significant whitespace
Dare,

> Whitespace is made significant by the presences of an 
> xml:space="preserve".

Thist only means that _all_ the whitespace for a given element is preserved,
this is a workaround that I know of, and are actually using. However, even
if this attribute is not set, semantically significant whitespace in mixed
content must be preserved. 

<sampleData>
	<!DOCTYPE a [
	....<!ENTITY uuml "ü">
	]>
	<a>
	....<b>aasdf...</b>
	....<c>
	........asdfasdf_dadf_.<e/>_asd_<d>asdfasd</d>_&uuml;adas
<d>asdfasd</d>_<d>asdfas</d>_
	........df_asd_.&uuml;_asdf_asdf.
	....</c>
	</a>
</sampleData>

In the above example I marked the whitespaces that in my oppinion should be
preserved regardless of whether whitespace handling is set to preserve or
not with a '.' and the whitespace that I think must be preserved in any case
with a '_'.

If the reader/parser removes the whitespaces marked with a '_', i.e. the
semantically significant whitespaces the semantic of the document is
changed.

E.g., given the fragment

	<d>die</d> &Uuml;berleitung

The meaning of 'die Überleitung' (expected result) is different to
'dieÜberleitung' (result returned by XmlReader).

So, I think there is a problem with the reader as it removes whitespace that
is semantically significant, and this, at least as I read the spec, should
not be done by an XML processor.

Bye

Axel

<result whitespaceHandling="significant and none">
[DocumentType] a ==> "
    <!ENTITY uuml "ü">
"
[Element] a ==> ""
[Element] b ==> ""
[Text]  ==> "aasdf   "
[EndElement] b ==> ""
[Element] c ==> ""
[Text]  ==> "
        asdfasdf dadf  "
[Element] e ==> ""
[Text]  ==> " asd "
[Element] d ==> ""
[Text]  ==> "asdfasd"
[EndElement] d ==> ""					// missing
whitespace node here
[EntityReference] uuml ==> ""
[Text]  ==> "adas "
[Element] d ==> ""
[Text]  ==> "asdfasd"
[EndElement] d ==> ""					// missing
whitespace node here
[Element] d ==> ""
[Text]  ==> "asdfas"
[EndElement] d ==> ""
[Text]  ==> "
        df asd  "
[EntityReference] uuml ==> ""
[Text]  ==> " asdf asdf 
    "
[EndElement] c ==> ""
[EndElement] a ==> ""
</result>

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.