[XML-SIG] Bugs 'n' bindings

Andrew Clover and-xml at doxdesk.com
Sat Jul 19 17:51:25 EDT 2003

Evening all,

I've been updating that table of bugs and other compliance issues I
posted earlier, which is the cause of the bug tracker mail spurt,
sorry about that. ;-)

The table can now be found at:


Meanwhile, I'm thinking we should update the Python DOM bindings in
the Python Library Reference, as it currently only defines the
Level 1 Core object types. I'd recommend:

  - DOMTimeStamp (L3 Core) to be bound to long.

  - DOMUserData (L3 Core) to be bound to any object/type.

  - UserDataHandler to be bound to any object with the appropriate
    method; user should not be expected to define the constants
    NODE_CLONED etc. inside the object. Similarly for NodeFilter
    (L2 Traversal) etc.

  - DOMInputStream and DOMReader (L3 Load) to be bound to any
    stream-like object, implementing read(n) method that returns a
    string object. (It would be expected, but probably shouldn't be
    required, that DOMInputStream would return narrow strings and
    DOMReader would return Unicode strings.)

  - DOMOutputStream and DOMWriter (L3 Save) to be bound to any stream-
    like object, implementing write(s) method that accepts a string
    (which in the case of DOMOutputStream will contain no characters

  - DOMException (L1 Core) ought really to be bound to *something*, so
    that authors can catch exceptions generated by any DOM implementation.
    xml.dom.DOMException would be a good candidate except that to my
    tastes it says too much about the implementation of the object
    (I'd really want a pure interface-like class to inherit from),
    and it isn't available in Python 2.0 (or earlier Pythons without
    the xml package for that matter). Any thoughts?

  - For that matter, the same goes for EventException, RangeException,
    etc. (L2)

Also the following changes seem sensible:

  - boolean to be redefined as optionally bound to the Python native
    boolean type (when available)

  - the obligation of a DOM implementation to support live editing
    of writable (childNodes) NodeLists through Python __setitem__ and
    __delitem__ methods should be removed (PLR The utility
    of this feature is limited (since no slicing or mutable sequence
    methods are available), and it's difficult for some kinds of DOM
    implementation to support. Plus in practical terms it's not actually
    supported properly (ie. keeping the tree consistent) by any Python
    DOM I know of. (*)

Also it might be useful to state explicitly that any reserved words
used by a DOM specification will be used with a trailing underline.
I don't think there are any Python reserved words in current DOM
specs, but an earlier draft of Level 3 Load/Save used 'is' quite a
lot for parameter names, so it could well happen.

(*) - well okay, not supported by any DOM except for my own pet DOM,
      currently unreleased, which sticks to standards to a pathological
      degree. I am a WaSP member after all, sorry...

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list