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

Re: whitespace in 1.1

remove cr from xml
In article <20030312234326.1ac58fb1.amyzing@t...> you write:

>> It doesn't look like XML 1.1 changes the S production of XML 1.0, so
>> while NEL is permitted in element and attribute content, it isn't
>> considered whitespace inside of markup components like tags and
>> declarations.

>I asked about this

... and you will shortly be receiving an official response to your
CR comment...

>and was told that it's supposed to be normalized to
>LF before whitespace processing happens.

Right.  Or at least, the result of parsing has to be as if it was done
like this.

>At which point I asked why CR
>was part of the S production,

I don't know why it is for sure.  The original wording of the line-end
normalization section in 1.0 was different (it was changed because it
was subtly inconsistent), and it may have seemed more reasonable at the
time.  For normal use, it makes no difference whether CR is in S or not.

> and was given this hideous hack, using
>parameter entities, that allows one to force an un-normalized CR into
>attribute content.

You can indeed do this - and you only need internal general entities,
not parameter entities - but I doubt that was actually considered as a
reason when XML 1.0 was written.

So, what should 1.1 do?  It could

(1) add NEL (and LSEP) to S, so you could do the same stupid entity hack;
(2) remove CR from S, because no-one really wants it and it's confusing;
(3) leave S as it is.

The trouble with (1) is that it would mean that there would be lots of
places where parsers had to apply different rules for 1.0 and 1.1
documents.  (Unlike the conversion to LF, which only happens in one
place for most parsers.)  This was not considered worth it for the
non-existent advantage of being able to put NELs in internal entities.

I'd be happy with (2), but it has the same problem: if we took CR out
of S in 1.1, parsers would have to reject it for 1.1 documents but
accept it for 1.0 documents.  So again it was not considered worthwhile.

(3) is ugly if you care about such things, but seemed like the least
bad choice.  Probably no-one will ever construct a document where it
makes a difference, except those of us who write test suites.

-- Richard


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.
First Name
Last Name
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.