[XML-SIG] 4DOM future

Andrew M. Kuchling akuchlin@mems-exchange.org
Wed, 3 Nov 1999 12:31:03 -0500 (EST)


Ken MacLeod writes:
>Just a quick note, after checking the DOM rec again I noticed that the
>main DOM API defines attributes as attributes, not as get/set APIs.
>Get/set is only in the Java binding appendix.  So as far as
>``compatiblity with the DOM rec'' goes, it clearly can go either way.

In the section "DOM Interfaces and DOM Implementations", there's some
text which reads:

1. Attributes defined in the IDL do not imply concrete objects which must
     have specific data members - in the language bindings, they are
     translated to a pair of get()/set() functions, not to a data member.
     (Read-only functions have only a get() function in the language
     bindings).
2. DOM applications may provide additional interfaces and objects not
     found in this specification and still be considered DOM compliant.
 
In other words, they didn't want to mandate having actual attributes
or properties in the spec, because in some languages such as C++ that
would be a serious constraint on implementors.  (No __getattr__ hook
there, after all.)  Part of my reasoning for having both attributes
and get_/set_ is for compability with Java -- users familiar with Java
DOM implementations don't have to remember to use attributes instead
of accessors, and code might be portable between CPython+PyDOM and
JPython+a Java DOM implementation.

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
Feistel and Coppersmith rule. Sixteen rounds and one hell of an avalanche.
    -- Stephan Eisvogel in de.comp.security