Generic way of parsing into dom?

Magnus Lie Hetland mlh at idi.ntnu.no
Sat Oct 6 13:41:27 EDT 2001


I've been looking at the 4Suite module 4XPath, and
noticed that in the tutorial the class Ft.Lib.pDomlette
is used. I liked the fact that the xpath module was
available as xml.xpath and found this name (the
domlette thing) a bit ... Shall we say ... specific.
OK - if you have the 4Thought 4Suite xpath module,
you probably have Ft.Lib.pDomlette as well, but
even so...

So I started looking at the xml.dom module to find a
more generic method of reading documents into a dom
structure. Before I installed 4Suite, xml.dom had
xml.dom.minidom as its default implementation, and
afterwards it had 4DOM. Great. But why is there no
default way of parsing this? Something that doesn't
require a specific package to be installed, but which
(e.g.) uses xml.sax to create an xml.dom object...
Or something. (Or, I'm sure there is, and that I'm
just being dim.)

In the HOWTO, I found xml.dom.ext.reader.Sax.FromXmlStream
but I assume that's tied to 4DOM... Or am I mistaken?

Anyway, why isn't there simply a function xml.dom.parse
(and probably xml.dom.parseString)? It just seems like
a natural thing to me... If there is something similar
somewhere that I've missed, then I'm sorry. Otherwise,
would it be possible to add something like this?

--

  Magnus Lie Hetland         http://www.hetland.org

 "Reality is that which, when you stop believing in
  it, doesn't go away."           -- Philip K. Dick






More information about the Python-list mailing list