[
Lists Home |
Date Index |
Thread Index
]
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 " �", 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, �
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@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
|