[XML-SIG] Working around problems in older DOM implementations

Andrew Clover and-xml@doxdesk.com
Sat, 29 Mar 2003 15:34:24 +0000


Afternoon,

I'm working on a DOM-based application which I want to be compatible with as
much of the installed base of Python DOM implementations as possible.

I'm using DOM Level 2 Namespace-aware Core methods only, with an importer
layer that fixes up known bugs in widely-deployed DOMs. I've checked minidom
from Python 2.1 and 4DOM from PyXML 0.6.6 so far, and added workarounds for
the following problems:

  - minidom: no native importNode support
  - minidom: insertBefore/appendChild/replaceChild with DocumentFragment
    Node fails to insert all new children due to destructive list iteration
  - minidom: attributes in no namespace get '' namespaceURI instead of None.
    Elements and attributes in no namespace get '' prefix instead of None.
  - 4DOM: elements and attributes in no namespace get '' namespaceURI and
    prefix instead of None.
  - 4DOM: localName of xmlns="..." declarations is '' instead of 'xmlns'.

Are there any other known problems with common DOMs I ought to be looking
out for?

cheers,

-- 
Andrew Clover
mailto:and@doxdesk.com
http://www.doxdesk.com/