Issues with Contribution: Attribute Default Value

Reference -
http://www.w3.org/TR/2000/CR-xmlschema-1-20001024/#sic-attrDefault

<snip>
Schema Information Set Contribution: Attribute Default Value

For each attribute use pair in the {attribute use pairs} whose boolean is
false and whose attribute declaration has a {value constraint} and does not
match one of the attribute information items in the element information
item's [attributes] as per clause 1.3 of Element Locally Valid (Complex
Type) (§3.4) above, the post-schema-validation infoset has an attribute
information item whose [local name] is that attribute declaration's {name}
whose [namespace URI] is the attribute declaration's {target namespace} and
whose [schema normalized value] is the declaration's {value constraint}
string, added to the [attributes] of the element information item.
Furthermore, the item's [specified] is set to schema.
</snip>

This is wonderful if there is no [namespace URI]. If there is a [namespace
URI], it raises two questions,

[1] Who is responsible for contributing a namespace declaration to this new
attribute's [owner element]?

[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?

Regards, Asir S Vedamuthu

Received on Tuesday, 12 December 2000 21:47:39 UTC