[XML-SIG] Re: saxlib 1.0beta

Andrew Kuchling akuchlin@cnri.reston.va.us
Fri, 8 May 1998 09:59:50 -0400 (EDT)


Lars Marius Garshol writes:
>Well, we don't preserve entity information either, or whitespace in
>tags, so writing an XML editor on top of this is probably not going to
>work anyway. In fact, all XML parsers I know of today throws away

	Hm.  IIRC, the DOM code does let you include comment objects
in a tree that you build; perhaps that's enough.  All right; we can
let this slide for the moment, and worry about writing XML editors
later.

>> Sharing drivers would also let both SAX and DOM use an ESIS driver, or
>> anything else that gets written.
>That we can do already, since ESIS does not contain comments. (Although
>one can pick out entity boundaries from an ESIS stream, although not
>from the one generated by nsgmls, if I remember correctly.)

	Hm, again.  My concern with layering DOM always on top of SAX
is performance; will the extra layer of calls cost very much?  The
problem is avoiding writing O(n**2) drivers, of course, connecting n
parsers to n different user-level APIs.  What does everyone think
about this?  
	
>If we think people will use the DOM without SAX I think we should do
>that, yes.

	Certainly we'll provide various helper functions which perform
the most common tasks of reading from a file object, and they may well
use SAX internally to build a DOM tree, or whatever.  The marshal
module I posted a while back uses both SAX and DOM, for example.

>    get_parser_name()  # xmllib, xmlproc, pyexpat or XML-Toolkit
>    is_validating()    # Only drv_xmlproc_val so far
>    reads_dtd()        # Will have to be defined carefully
>    is_fast()          # Only pyexpat returns true here

	Good idea.  One formatting question: should method names be in 
the words_separated_by_underscores style, or in the
mixedCaseStudlyCaps variety?  SAX seems to follow the studlycaps
route.

-- 
A.M. Kuchling			http://starship.skyport.net/crew/amk/
The purpose of the present course is the deepening and development of
difficulties underlying contemporary theory...
    -- A. A. Blasov