[xml] Wrong error message when parsing SVG.xsd



Hi,

Using the SVG xsd schema, and even just parsing it with xmllint fails:

$ xmllint http://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd
http://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd:12: error: xmlSAX2StartElementNs: out of memory
lementFormDefault="unqualified" attributeFormDefault="unqualified" xml:lang="en"
                                                                               ^
http://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd:14: parser error : Extra content at the end of the 
document
  <import namespace="http://www.w3.org/1999/xlink"; schemaLocation="xlink.xsd"/>

The error message is actually absolutely wrong, since there is
not much memory used (valgrind says around 80KB).

What happens is that xmlNewNs() fails in xmlSAX2StartElementNs because
what is passed to xmlNewNs fits the following:

if ((prefix != NULL) && (xmlStrEqual(prefix, BAD_CAST "xml")))
    return(NULL);

xmlSAX2StartElementNs throws an OOM error when xmlNewNs returns NULL...

I don't know if it's supposed to be valid to use
xmlns:xml="http://www.w3.org/XML/1998/namespace"; in a xml file, though.
From a quick glance at the spec, while it says
"The prefix xml is by definition bound to the namespace name
http://www.w3.org/XML/1998/namespace.";, it doesn't seem to say anything
about explicitely writing it being forbidden...

Cheers,

Mike

PS: Posting here, because it seems bugzilla is not read... I have 3 patches
in there that are bitrotting. (613466, 613467, 625851)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]