Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Re: Weirdness (and bugfix for) XML::DOM ...

by mirod (Canon)
on Feb 26, 2001 at 16:23 UTC ( #60855=note: print w/replies, xml ) Need Help??

in reply to Re: Weirdness (and bugfix for) XML::DOM ...
in thread Weirdness (and bugfix for) XML::DOM ...


In Rule 59 the S? is defined by:

White Space [3] S ::= (#x20 | #x9 | #xD | #xA)+

So (  toto  |  tata  ) is just as valid as (  toto  | tata  ). The problem is that expat and XML::Parser report _everything_ in the document, including non-significant spaces. Now Expat is required by the spec to do so. XML::Parser could probably choose to normalize those whitespaces but does not, and XML::DOM definitely should normalize them but does not. The SAX-2 extension for declaration for example normalizes declarations by removing all spaces around tokens.

The bottom-line is that this is a feature of XML::DOM that could easily pass for a bug (and should be fixed as soon as somebody provides a patch, I certainly don't want to get involved in XML::DOM but line 1970 of the in libxml-enno-1.04pre3 seems like the place to insert the normalization for attribute declarations, then on to element content models before line 2343).

As a side note, the best way to read the XML specification is probably to go to The Annotated XML Specification for the spec and Tim Bray's comments on

Update: Crap! My mistake (as usual :--(, XML::DOM (or maybe XML::Parser) does normalize attribute declarations. Actually that's why the test fails. It is fixed in libxml-enno-1.04pre though. The only remaining problem is that 1.04 does not pass the test on 5.6.0

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://60855]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-09-29 13:34 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.