[XML-SIG] Reconsidering the DOM API

Benjamin Saller case@appliedtheory.com
Wed, 28 Jun 2000 11:12:35 -0400 (EDT)

Today, Walter Doerwald wrote:

    At 15:22 28.06.00, Benjamin Saller wrote:
    >Today, Walter Doerwald wrote:
    >     Why not put children and attribute access into __getitem__
    >              c = b[0][1][0]["abc"]
    >Try to maintain that a month after you wrote it ;>
    I don't see a problem here. When you want something that is short,
    because you use it *all* *the* *time*, then you won't forget how it
    works. What's the difference between remembering that [index] gives
    you the index'th child and remembering that _get_childNodes(index)
    does it?

That was unfair of me. The two examples you have are obviously equivalent.
My problem is not that either example is more or less expressive than the
other. I just tend to think that for the same reason we use DNS rather
than IP addresses referring to your document in terms of numbers and
offsets is less maintainable than an XPath like notation. In many ways the
DOM removes the human readable advantages of XML because code no longer
reflects that the objects are human readable and carry with them domain

Benjamin Saller                                     <case@appliedtheory.com>
Technical Strategist                                AppliedTheory
	Where tire hits pavement on the Information super-highway,	
			 that's where my head is...