[XML-SIG] DOM test failures

Martin v. Loewis martin@v.loewis.de
Fri, 14 Dec 2001 18:01:04 +0100


> You are right, in the sense that the code violate the DOM2 spec, but I
> think the code have the _big_ advantage to allow dom tree manipulations
> without knowing if the dom tree have been created using the NS interface =

> or not.

I think we must distinguish a number of use cases here:

- the DOM tree is created through an XML parser, through
  xml.dom.ext.reader. I definitely agree that the user should be able
  to use both NS and non-NS API afterwards. I also don't think this
  would violate the DOM spec, since everything that the reader does
  is out of scope of the spec, anyway.

- the application has created nodes explicitly through the DOM API.
  In this case, the DOM mandates that .nodeName, .name are
  synchronized with .localName and .prefix. The big advantage that
  you see is mandated by the DOM.

- the application creates nodes through the level 1 API. The DOM
  mandates that the level 2 attributes are all null, yet you claim
  that they ought to be synchronized. In what way? And why is this
  a big advantage?=20

Just notice that the current CVS also gets it wrong:

>>> import xml.dom.ext.reader.Sax2
>>> d=3Dxml.dom.ext.reader.Sax2.FromXml("<foo></foo>")
>>> d.createElement("my:foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/dom/Document.py", l=
ine 88, in createElement
    return self.createElementNS(EMPTY_NAMESPACE,tagname)
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/dom/Document.py", l=
ine 165, in createElementNS
    raise NamespaceErr()
xml.dom.NamespaceErr: Ung=FCltige oder unerlaubte Namespace-Operation.

Using the non-NS API, it should be possible to create an element whose
name has a colon in it, yet the implementation refuses that.

Regards,
Martin