[XML-SIG] DOM API
Wed, 21 Apr 1999 18:36:45 -0500
This is a cryptographically signed message in MIME format.
Content-Type: text/plain; charset=us-ascii
First, for those of you that think PyDOM is heavy weight you obviously haven't
treid 4DOM :)
But, then that is its purpose. We built it to follow the W3C spec to the
letter so it is big and can be not very user friendly at times. However, it
is completely usable over an ORB or COM with clients in Java, C++, COBOL
whatever. It fits our needs nicely. And as Paul mentions, with somany other
people starting to use it I imagine the CORBA functionality will be usefull to
others as well.
I see PyDOM as its light weight brother. It gets all of its speed increase
from not having to wrap every list in a NodeList, and not having to wrap every
dict in a NamedNodeMap. Last I looked it also does not create some of the
"not so important" nodes such as Attrs.
Do we really need a third interface?
qp sounds like a great optimization if you don't care about the original
document structure or PIs. (you could never get 4XSL to use this interface).
In some cases you may care about the document structure but not care about
name spaces, or attributes, or elements... I think if we try to make it any
more lite weight we will only satisfy 1/2 of us because we will need to start
dropping "non important" parts of the original document. If you really need
more speed, then grap SAX or expat and go. or post the super modifed class as
libraries, not standard APIs.
Back to the subject at hand. I think that PyDOM and 4DOM could have a
standard interface for applications built on top ie 4XSL. I think we would
have to come both ways a little though. Ex. I think it would be very hard to
get rid of the idea of a Attr class from 4DOM, while I think we could very
easily extend the NodeList class to support native python list manipulation.
This would only be the case if the application is never intended for use over
an ORB (cannot call __getitem__ over an ORB very easily).
If we do this though, I don't see that alot will be gained. You can swap in
and out DOM implementations when ever you like, but you would not be able to
use the 4DOM implementation and expect 4XSL to function over an ORB. If
applications that use the DOM use 4DOMS new "quick" API then the speed will be
about equivelent to that of PyDOM (probably still a bit slower but not by
much). Your choice would be down to, do I like Andy better, or Mike...:)
Paul Prescod wrote:
> Fredrik Lundh wrote:
> > the downside with Paul's line of reasoning is that it makes it
> > impossible to come up with something that is light-weight
> > also from the CPU's perspective... not good.
> That isn't true. I tend to think that usability is more important than
> performance but if we decide to optimize for performance then we can make
> a DOM-compatible API that is as fast as "qp". I mean the only thing that
> is harder to implement in the miniDOM is siblings -- where I chose
> convenience over efficiency. We can make the opposite choice.
> In fact, I think that the namespace and language support in qp already
> makes it relatively "heavyweight".
> > I want something really light-weight, and highly pythonish, and I
> > don't care the slightest about TLA compatibility.
> It isn't a question of TLA compatibility. It's about using the data models
> used everywhere else in the world. Python conforms to posix conventions
> for file and socket operations, C conventions for string interpolation,
> Perl conventions for regular expressions, Unix conventions for globbing
> and so forth. If I wanted idiosyncratic invented-just-for-us interfaces I
> would go and use Perl.
> To me, this is the central issue: to me, the Guido's genious lies in the
> fact that he usually chooses adapt something before re-inventing it. This
> makes learning Python easy. "Oh yeah, I recognize that from the other
> languages I use." Well, SAX and DOM are what the other languages use.
> Anyhow, "qp" is hardly more "Pythonic" than in the lightweight DOM API.
> The following_cdata stuff is not like any API I've ever seen in Python or
> elsewhere. The call for "pythonic-ness" is mostly a strawman. The DOM
> works better in Python than in almost any other language: Nodelists are
> lists, NamedNodeLists are maps, object types are instance classes, lists
> can be heterogenous, etc.
> Paul Prescod - ISOGEN Consulting Engineer speaking for only himself
> "The Excursion [Sport Utility Vehicle] is so large that it will come
> equipped with adjustable pedals to fit smaller drivers and sensor
> devices that warn the driver when he or she is about to back into a
> Toyota or some other object." -- Dallas Morning News
> XML-SIG maillist - XML-SIG@python.org
"No program is interesting in itself to a programmer. It's only interesting as
as there are new challenges and new ideas coming up." --- Linus Torvalds
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature