[XML-SIG] DOM API

Mike Olson mike.olson@fourthought.com
Wed, 21 Apr 1999 18:36:45 -0500


This is a cryptographically signed message in MIME format.

--------------msE1C4377628C886A3F4622D9F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


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...:)

Later


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
>  http://itrc.uwaterloo.ca/~papresco
>
> "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
> http://www.python.org/mailman/listinfo/xml-sig

--
Mike Olson
Member Consultant
FourThought LLC
http://www.fourthought.com http://opentechnology.org


---

"No program is interesting in itself to a programmer. It's only interesting as
long
as there are new challenges and new ideas coming up." --- Linus Torvalds


--------------msE1C4377628C886A3F4622D9F
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIIKmQYJKoZIhvcNAQcCoI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