[XML-SIG] SAX prettyprinter V2 and SGMLOP

Lars Marius Garshol larsga@ifi.uio.no
23 Jan 1999 16:54:30 +0100


* Lars Marius Garshol
|
| How is the performance when you use sgmlop directly compared to when
| you use it's SAX driver?

* Christian Tismer
| 
| I didn't try yet since I was very happy with the speed.

Would be interesting to know, though, since it will tell us something
about what the penalty of using SAX is, compared to doing it directly.

| I could no use pyexpat yet, since a pyexpat dll is missing.  I will
| build one for Windows (as I also did before with sgmlop, the binary
| in the CVS was broke).

Both the pyexpat and the sgmlop DLLs are in CVS and both of them work
for me. Maybe you should try a 'cvs update'? :)

| Is a SAX parser required to report ignorableWHitespace events?

No, and in fact non-validating parsers cannot tell the difference if
they haven't read the DTD. (AElfred reads the DTD to be able to
provide this information, but does not validate.)

See

<URL:http://www.stud.ifi.uio.no/~larsga/download/python/xml/sax-spec.html#DocumentHandler>

| Or is it also allowed to never call this method, as sgmlop does?  If
| so, then the interface doesn't make too much sense since I have to
| collect all data and handle whitespace when the next tag appears.

I agree that this is suboptimal, but the problem springs from the
design of XML itself. Most parsers simply do not have the information
required to know when to call this method.

--Lars M.