[xml-bindings]namespace declaration attributes in DOM2



Hello,

We are implementing a dom2 compliant wrapper for libxml2 in object-pascal
(delphi/kylix).

(See: http://sourceforge.net/projects/libxml2-pas/)

In the moment we are trying to make the dom work with namespace-declaration
attributes, as if they where normal attributes.

We want to implement the following XP-Tests, to check if it our
implementation
is correct, but I am not shure, whether all this stuff is really neccessary,
to be dom2 compliant.

The specification is incomplete, regarding this issue.

Any comments wellcome (and any links to more information on this issue):


RFC - Handling of namespace declaration attributes in DOM2
----------------------------------------------------------

Related Documents:

http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/


As far as I know, namespace attributes shall appear on the named node map
of attributes of a node.

This means:

a) parsed namespace attributes must appear in attributes.length

b) they must be accessable with attributes.getNamedItemNs

c) their namespace-uri must be 'http://www.w3.org/2000/xmlns/'

(attributes.getNamedItemNs('namespace').namespaceURI='http://www.w3.org/2000
/xmlns/'

d) they must be writable with attributes.setNamedItemNs

e) they must be removable with attributes.removeNamedItemNs;
   if there is exist an attribute or an child, or an attribute
   of any of the children or children of children, than an
   namespace error must be raised.

f) they must be appendable with element.setAttributeNodeNs

g) they must be writable with element.setAttributeNs

h) they must be readable with element.getAttributeNodeNs

i) they must be readable with element.getAttributeNs

j) they must be found be element.hasAttributeNs

k) they must be removable with element.removeAttributeNode and
   element.removeAttributeNs;
   if there exists an attribute or a child, or an attribute
   of any of the children or children of children, that needs
   the namespace declaration, than an namespace error must be raised.

l) if you create an element with document.createElementNs, than the
   namespace declartation attribute must be created automatically
   and must appear in element.attributes

m) if you append a namespace declaration attribute, that already exists on
   an element, it must not be appended a second time, and no error
   should be raised

Uwe Fechner, 19.02.2002




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]