[XML-SIG] Re: HtmlBuilder - uses sgmllib, can it use sax/pyexpat?

Greg Stein gstein@lyra.org
Thu, 01 Apr 1999 13:00:39 -0800

Jeff.Johnson@icn.siemens.com wrote:
> To Greg: Most of my code uses DOM so I'm not sure if I could use your parser.
> Would it be possible to add a DOM interface (or subset) to the objects it
> creates?

It would be possible, but it is important to note that DOM compatibility
was specifically excluded from its design principles. That's how come it
can go so much faster :-). Basically, it just presents an alternative
data representation for XML.

Actually, if it *just* exported the API, but no change was made to how
the structure is built, then it would probably work fine.

Note that Andrew is testing a similar technique for DOM building: skip
the API and smack the underlying data structure.

Ooh. And I just saw a way to make qp_xml a bit faster. The attribute
handling shouldn't create separate objects. I should create a mapping of
(ns, name) -> value. That will help during lookup, too.

Andrew: I was thinking this might be a nice alternative mechanism that
can go into the XML package. Where would it go? Maybe call it
xml.parsers.quick or something. Of course, it isn't as quick as plain
pyexpat :-), but then it also isn't a parser in the same sense as those.
Under util?


Greg Stein, http://www.lyra.org/