Paul Prescod paul@prescod.net
Fri, 21 May 1999 12:51:43 -0500

Lars Marius Garshol wrote:
> What do people think? Is this better than adding the suggested
> improvements to the SAX core? This was just hacked together in 15
> minutes, so please don't hesitate to slaughter it if you don't like
> it.

I'm not thrilled with the fact that it requires an explicit adapter
instead of a simple base class. My counter-proposal is that easySax be a
base class that defines startElement, endElement and characters.

easySax "clients" would define start_Foo, end_Foo,..., startUnknown,
endUnknown processingInstruction and "text", where text is defined as a
Python programmer would expect: as a simple string without the index junk.

What you do with captured text is highly context specific. What if we had
TITLE_text, BODY_text, FOO_text and Unknowntext. Then if Unknowntext isn't
defined we wouldn't be storing away little useless text snippets all of
the time (e.g. if we were just looking for titles).

 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself

Alabama's constitution is 100 years old, 300 pages long and has more than
600 amendments. Highlights include "Amendment 393: Amendment of Amendment
No.  351", "Validation of Laws Regulating Court Costs in Randolph County",
"Miscegenation laws", "Bingo Games in Russell County", "Suppression
of dueling".  - http://www.legislature.state.al.us/ALISHome.html