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);
> 	http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document
>
> Attr Element.setAttributeNodeNS(in Attr newAttr) raises(DOMException);
> http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
>
> 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" -
> http://www.w3.org/TR/DOM-Level-2-Core/glossary.html#dt-qualifiedname
>
> 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