[XML-SIG] New XML module

Uche Ogbuji uche.ogbuji at fourthought.com
Fri Nov 11 22:48:10 CET 2005


On Fri, 2005-11-11 at 15:21 -0600, Richard Salz wrote:
> > In retrospect I
> > think it was a mistake to even bless SAX and DOM by putting them in the
> > stdlib.
> 
> On the one hand I agree with this -- why should these pigs be better than 
> any other animals on the farm -- but on the other hand, as someone who 
> wants to build higher-level facilities on top of XML, it's a real pain. 
> "The nice thing about standards is that there's so many to choose from" 
> was a complaint, not praise, and string.replace('standards', 'doms') does 
> not make it any better.

Well WXS was supposed to be the one schema standard to choose from,
right? ;-)  I also wonder how many people will accept XQuery as the
default way to access collections of XML.

But taking tongue out of cheek, I think my problem with your point lies
in "string.replace('standards', 'doms')".  I'm quite fine with the idea
of minidom as the Python standard DOM (even though I prefer our own
Domlette).  But this is not a matter of blessing one of many DOMs, it's
a matter of blessing one of many processing idioms entirely.  DOM is but
one class.  Here is a categorization I've used:

A. Python DOMs: minidom, Domlete, pxdom, etc.
B. Python Infosets: ElementTree, pyRXPu, etc.
C. XML-schema-driven data bindings: GenerateDS, etc.
D. Python-schema-driven data bindings: XIST, Guido's module (I think),
etc.
E. Non-schema-driven data bindings: Amara bindery, xmltramp, Gnosis,
etc.
F. Call-back stream APIs: SAX, PyExpat, etc.
G. Iterator stream APIs: ElementTree iterparse, Amara pushbind, pulldom,
etc.

Python's stdlib currently blesses one from A, two from F and one from G.
Guido's proposal would add one from D.  I suppose one could argue that
it's OK to have one from each category, but I say that would just
confuse the heck out of users.  One could argue that even having 5
entries would confuse the heck out of users.  Or is that no worse
confusion than having two dozen viable third-party options?  I don't
know.

I do know one thing:  I can think of situations where I would prefer
each of A through G.  Some idioms really are better than others for some
tasks.  XML is incredibly diverse, and I think it's very hard to pick
one-size-fits-all solutions.  That's the main concern that gives me
pause.


-- 
Uche Ogbuji                               Fourthought, Inc.
http://uche.ogbuji.net                    http://fourthought.com
http://copia.ogbuji.net                   http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/



More information about the XML-SIG mailing list