Re: [xml-dev] [a proposal] about NS 1.1

My previous notes [1] discussed the benefits of incorporating qualified
names as a primitive type. I admit that the suggestions are difficult to
reconcile with the belief, that namespace-aware documents still encode
text only. The in-scope namespace information item attempts to enable
the correct interpretation of such documents without the benefit of
declarations as tocontent value domains. It cannot succeed. As an
alternative I suggest that the following passages be incorporated in the
normative description of the operation of a namespace-aware XML
processor. While this proposal is inferior (in terms of both efficacy
and implementation complexity) to the earlier proposal to include QNAME
and QNAMES as tokenized types, it would at least afford applications the
opportunity to effect correct decoding and encoding namespace-aware
documents if they should need to do so.

----------------------------------------------------------------

?.? Qualified Name Handling

In editing XML documents, it is often necessary to use universal names
to identify document components. Where such names are themselves encoded
in XML documents, they appear as qualified names. The qualified names
can, however, be interpreted in a context of in-scope namespaces only.
In-scope namespaces have dynamic extent only. As a consequence, the
reference of a qualified name to its universal counterpart has lexical
scope only. This constraint may lead to operational difficulties in the
case where editing these expressions invalidates the prefix reference or
otherwise modifies the applicable in-scope namespaces as the intent of
the universal name counterparts is that they have indefinite extent.

For correct operation in such situations an application must be able to
require that a namespace-aware XML processor pass qualified names to the
application in a form where prefixes have been resolved, or expanded, to
replace them with the namespace name to which the prefix was bound in
the in-scope namespaces at the point where the prefix appeared in the document.

A special attribute xml:qnames may be attached to an element to signal
an intention that in that element qualified names which appear in
attribute and element content be reported to the application in resolved
form. In valid documents, this attribute, like any other, must be
declared if it is used. When declared, it must be given as an enumerated
type whose values are one or both of "resolve" and
"preserve". For example:

<!ATTLIST  xslt:element use-attribute-sets (resolve) #FIXED 'resolve' >

The value "preserve" signals that documents intent that qualified names
be reported as they appear in the encoded document. The value "resolve"
indicates that the document intends that qualified names be reported in
resolved form, that is, as universal names. This declared intent is
considered to apply to all elements within the content of the element
where it is specified, unless overriden with another instance of the
xml:qnames attribute.

The root element of any document is considered to have signaled the
intention that qualified names be preserved, unless it provides a value
for this attribute or the attribute is declared with a default value of 'resolve'.


?.? Qualified Name Resolution

Within the scope of an xml:qnames attribute with the value 'resolve' the
value of an attribute and character data in element content must be
normalized by the XML processor such that every embeded qualified name
is replaced by the embeded universal name obtained by replacing the
qualified name prefix with the brace-delimited value of the prefix's
namespace name binding apparent in the in-scope namespaces at the point
in the document where the qualfied name appears. For example, where in
the case of an element like

<xsl:element name='xsd:int' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xml:qnames='resolve'>

the value of the name attribute would be reported as '{http://www.w3.org/2001/XMLSchema}int'.

Within the scope of an xml:qnames attribute with the value 'resolve' the
value of an attribute and character data in element content must be
encoded by the XML serializer such that every embeded universal name is
replaced by the embeded qualified name obtained by replacing the the
brace-delimited namespace name with the prefix value of the namespace's
namespace name binding apparent in the in-scope namespaces at the point
in the document where the universal name appears.

...

[1]
http://lists.w3.org/Archives/Public/www-xml-blueberry-comments/2002Apr/0117.html
http://lists.w3.org/Archives/Public/www-xml-blueberry-comments/2002Apr/0124.html

Received on Sunday, 14 April 2002 04:58:44 UTC