[XML-SIG] Writing DOM-neutral code

Martijn Faassen faassen@vet.uu.nl
Sat, 8 Dec 2001 20:00:43 +0100


Rich Salz wrote:
> I know that on the face of it that's a silly question -- it's the whole
> point of having a standard (albeit crappy:) API.
> 
> If I have an element, e, then
> 	Using pyxml (4dom) dom, e.attributes is a list
> 	Using cDomlette, e.attributes is a dictionary;
> 		e.attributes.values() is what is needed

ParsedXML's DOM implementation comes with this giant set of unit tests
for compliance. Not even ParsedXML's DOM completely complies yet :), but
that is I think in part due to a bug in the unit tests themselves.

What needs to be done, and what I started doing but got side-tracked,
is check in this set of tests into PyXML so that we can validate other
DOMs against it. It ought to work with at least 4DOM as well (currently it
doesn't; it causes many failures and even some *hangs* if you run these
tests against 4DOM).

Eventually for the lightweight DOMs we might want to create a stripped down
set of minimal tests to ensure they're compatible as well.

Finally, I'm interested in read-only DOMs, as they should be usable in 
many cases (such as XPath and XSLT). Creating a test suite for only the
read-only parts of the DOM is more difficult, but I think well worth it.

I guess I should just check in the test suite as it is now. Are some people
interested in helping with hunting and fixing errors in it, and 4DOM, as they
are found?
 
Regards,

Martijn