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

Re: Sean McGrath hits a home run


xmltextreader.normalization
On Mon, Dec 16, 2002 at 07:19:37AM -0800, Tim Bray wrote:
> http://www.itworld.com/nl/xml_prac/04182002/
> 
> Outstanding. -Tim

<snip>
  The biggest conclusion I have come to is that APIs are fundamentally
good as shortcuts to getting your work done, but *only* if you fully
understand what is going on underneath. Using APIs as a substitute
for understanding what is really going on under the hood is a bad idea
which will come back to haunt you.
<snip>

 That hit a nerve, especially since I'm working on implementing the
C#/ECMA API XmlTextReader and found that gem

<snip2 href="http://dotgnu.org/pnetlib-doc/System/Xml/XmlTextReader.html#XmlTextReader.Normalization%20Property">
XmlTextReader.Normalization Property
public bool Normalization { get; set; }
Summary
Gets or sets a value indicating whether to normalize white space and attribute values.
Property Value
A Boolean where true indicates to normalize; otherwise, false . The default is false .
[...]
If System.Xml.XmlTextReader.Normalization is set to false , this also disables character range checking for numeric entities. As a result, character entities, such as " &#0;", are allowed.

[Note: See "Attribute-Value Normalization" in the W3C XML 1.0 recommendation, REC-xml-19980210.
</snip2>

  So basically, here we have an API, buried within the definition of a language
framework accepted in a standard organization whose behaviour is explicitely
and by default made non-conformant to the XML specification. Unless
XmlTextReader is not supposed to be used to parse XML - which sounds
unlikely - I find this a bit hard to swallow.

  Don't tell me that had to be a side effect of an implementation bug, &#0;
is not XML, that was known at the time the API was designed, it's not like 
documenting a software bug, it really feel like an API pushed against the 
specification. Same of course for the normalization which is a must in the
spec. This raises really one key of Sean' article points, the API is not 
the protocol or format it's supposed to give access to, but how many will
actually bother to check ?
  I'm relatively unhappy about this and I think I'm gonna make some quick
checks and possibly bug report against the free software C# implementations
if needed...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@r...  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

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.