Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Newbie question: QNames in content.

From: cmsmcq@---.--- (-. -. ----------------)
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent