Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Newbie question: QNames in content. >Thread Next - Re: Newbie question: QNames in content. Re: Newbie question: QNames in content.To: NULL Date: 6/10/2005 1:46:00 PM Bjoern Hoehrmann <bjoern@h...> writes:
> * Gleb Alexeev wrote in comp.text.xml:
>> It seems to me that "euType" value is in empty namespace but
>> compliance test suite expects that I parse it as
>> {http://opcfoundation.org/webservices/XMLDA/1.0/:euType}. Who is
>> wrong?
> Do you have a pointer to this test suite? I'd agree that it is
> "euType" in no namespace, but the XML Schema specification is not
> really clear about this...
In what way is it unclear? Serious question -- if the
spec doesn't seem clear to you, it would be helpful to
know what you find confusing, or what you would like to
know that the spec is not telling you, so that the spec
can be fixed.
It seems clear to me (admittedly, I may be biased by long
familiarity). It says:
[Definition:] QName represents XML qualified names. The ·value
space· of QName is the set of tuples {namespace name, local part},
where namespace name is an anyURI and local part is an NCName. The
·lexical space· of QName is the set of strings that ·match· the
QName production of [Namespaces in XML].
Note: The mapping between literals in the ·lexical space· and
values in the ·value space· of QName requires a namespace
declaration to be in scope for the context in which QName is used.
So the question is purely: in the example, is there a
namespace declaration in scope for the empty prefix?
<GetProperties
LocaleID=""
ClientRequestHandle=""
ItemPath=""
ReturnPropertyValues="true"
xmlns="http://opcfoundation.org/webservices/XMLDA/1.0/">
<q1:PropertyNames
xmlns=""
xmlns:q1="http://opcfoundation.org/webservices/XMLDA/1.0/"
>euType</q1:PropertyNames>
</GetProperties>
To the extent that there are complications here, it seems to me
they lie in the application of the Namespaces Rec.
In Namespaces 1.0, clause 5.2 says
A default namespace is considered to apply to the element where it
is declared (if that element has no namespace prefix), and to all
elements with no prefix within the content of that element. If the
URI reference in a default namespace declaration is empty, then
unprefixed elements in the scope of the declaration are not
considered to be in any namespace.
It seems to me (subject to correction) that the xmlns="" on the
q1:PropertyNames element counts as the relevant namespace
declaration required by the XML Schema 1.0 spec.
Namespaces 1.1 does change the use of the empty string as the value of
a namespace declaration value, by allowing to appear as the value of
an attribute with a PrefixedAttName. The usage of xmlns="" is
unaffected.
In this case, I think the value of "euType" is {}euType, or
equivalently (,euType) -- i.e. the namespace name / local name pair
whose second member is 'euType' and whose first member is absent.
I hope this helps.
-C. M. Sperberg-McQueen
World Wide Web Consortium
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
