Newbie question: QNames in content.

G

Gleb Alexeev

Hello.
We're working on web service implementation according OPC XMLDA
specification, please see wsdl extract below.
Code:
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://opcfoundation.org/webservices/XMLDA/1.0/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://opcfoundation.org/webservices/XMLDA/1.0/">
....
<s:element name="GetProperties">
<s:complexType>
...
<s:element minOccurs="0" maxOccurs="unbounded" name="PropertyNames"
type="s:QName"/>
...
</s:complexType>
</s:element>

How should I interpret the value of PropertyNames element in the
following request:
Code:
<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>
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?
 
G

Gleb Alexeev

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..
Thanks for your reply. Unfortunately, this test suite is accessible
only to members of OPC foundation. Since I'm not expert in XML I
decided to ask here for clarification before reporintg defect in the
test suite.
 
G

Gleb Alexeev

reporting defect in the test suite
And because of that I'd really appreciate any pointers to specs that
could prove I'm right or wrong.
 
C

C. M. Sperberg-McQueen

Bjoern Hoehrmann said:
* Gleb Alexeev wrote in comp.text.xml:
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
 
B

Bjoern Hoehrmann

* C. M. Sperberg-McQueen wrote in comp.text.xml:
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.

Yes, but as Michael Kay pointed out in

  http://lists.w3.org/Archives/Public/www-xml-schema-comments/2002OctDec/0091.html

this does not define the mapping. So, where is it defined?
 
G

Gleb Alexeev

Thanks a lot for your answers.
Yes, but as Michael Kay pointed out in


this does not define the mapping. So, where is it defined?
Ok, the problem described there doens't apply to my case because
Michael Kay wrote about ambiguity between default namespace and empty
namespace when prefix is omitted. However in my case default namespace
*is* empty namespace for PropertyNames element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,247
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top