RE: Issues with Contribution: Attribute Default Value

> [2] If schema processor uses DOM, it may contribute an attribute
> by invoking
> two methods sequentially,
> Attr Document.createAttributeNS(in DOMString namespaceURI, in DOMString
> qualifiedName)
>                    raises(DOMException);
> Attr Element.setAttributeNodeNS(in Attr newAttr) raises(DOMException);
> If you observe closely, one of the parameters is 'qualifiedName'.
> 'qualifiedName' is defined as,
> "A qualified name is the name of an element or attribute defined as the
> concatenation of a local name (as defined in this specification),
> optionally
> preceded by a namespace prefix and colon character" -
> mm .. 'namespace prefix' is required. Schema processor may introspect
> [in-scope namespaces] and compute a prefix, if one exists. If not, who is
> responsible for computing a SUPERFICIAL PREFIX and contributing a
> corresponding namespace declaration?

The DOM does absolutly no validation when creating an XML document. If you
do not use the DOM to add xmlns attributes, it will create invalid XML, but
it won't stop you from adding attributes and elements that use namespaces.
So it is up to the application that is using the DOM to do the right thing
if it wants valid XML. If there are no xmlns attributes that define
namespace prefixes, it isn't valid. The term SUPERFICIAL PREFIX should be
immediatly struck from the record and never used again, because there is no
such thing.

David Cleary
Progress Software

Received on Wednesday, 13 December 2000 09:33:48 UTC