[XML-SIG] Speeding up DOM reading

Martin v. Loewis martin@v.loewis.de
Mon, 17 Dec 2001 09:48:39 +0100


> Reading the documentation, it appreas that there are differnt modules
> around for reading in (and validate) XML, but I never found a hint on
> how to do it. What should I do instead of:

Why do you want to do something different?

You have a choice of different DOM implementations:

- 4DOM (which you use currently, pure-Python, full-featured, fairly slow)
- minidom (pure-Python, somewhat faster than 4DOM)
- pDomlette (if you have 4Suite installed, pure-Python, similar to minidom)
- cDomlette (4Suite, C, fairly fast, read-only)

and you have a choice of different XML parsers

- xmlproc (validating, pure Python, fairly slow)
- expat (non-validating, C, fairly fast)
- sgmlop (quite fast, restricted support for XML only)

and you have a choice of XML parser APIs

- native parser interface (fairly fast, requires special support)
- SAX (slower, allows to implement driver-independent readers)

Pick one of each group, and we can tell you

- whether this combination is supported
- how to build a DOM tree using this combination (if supported)

If you want a super-fast validating XML parser with a super-fast
complete Level 2 DOM implementation: that is not supported in PyXML.
You'll have to compromise, that's why there are so many options.

HTH,
Martin