W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

RE: Error in Primer? ... xpath expressions in keys

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Fri, 13 Jul 2001 15:13:05 -0400
To: "'Roger L. Costello'" <costello@mitre.org>, <xmlschema-dev@w3.org>
Message-ID: <001e01c10bcf$dac628c0$d98f143f@xmls>
Hi Roger,


> Does that sound reasonable?  Well, there's a problem.  Look at the
> schema again.  The two elements, parts and part are "local" elements.
> By definition, only global elements are "in the namespace".  So
> {http://www.example.com/Report}:parts and
> {http://www.example.com/Report}:part do not exist.  Rather, the two
> elements are in "no namespace".

The example in the Primer has elementFormDefault="qualified".  Local,
qualified elements are "in the namespace", so the Primer example is correct.

> I *think* that the way to do it is to declare a namespace prefix and
> assign it to no-namespace:
>    xmlns:bitBucket=""
> and then qualify parts and part with bitBucket:
>  <selector xpath="bitBucket:parts/bitBucket:part"/>

This is not valid according to the Namespaces rec. You can make the default
namespace an empty string (e.g. xmlns=""), but not a prefix.

If the elements involved are unqualified, you cannot use a default namespace
for the XML Schema namespace; you are forced to map a prefix to it.  You
would then leave the element names in the XPath unprefixed.  In the absence
of a default namespace declaration, unprefixed names are "in no namespace."

Hope that helps.


Priscilla Walmsley
Vitria Technology
Received on Friday, 13 July 2001 15:12:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC