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

> First, are there any validators which implement identity constraints?
> I have checked the following validators and they do not: xsv 1.2, 
> xerces 1.4.1, and XML Spy 4.0b.

Yes, TIBCO Extensibility's latest validator does support identity
constraints (and, in fact, the full XML Schema Recommendation).  See XML
Validator 1.0 or Turbo XML 2.2 at http://www.extensibility.com.  In Turbo
XML, be sure to turn on strict validation mode in the project preferences.

> Second, I am beginning to question my understanding of xpath 
> expressions in <select> or <field> elements...

I agree with Priscilla's comments except for one point. The XPath expression
"parts/part" refers to parts and part each in no namespace, not the default
namespace.   From the XPath rec, section 2.3 on Node Tests:

"... the default namespace declared with xmlns is not used: if the QName
does not have a prefix, then the namespace URI is null ..." 

xan

Xan Gregg
TIBCO Extensibility

-----Original Message-----
From: Priscilla Walmsley [mailto:priscilla@walmsley.com]
Sent: Friday, July 13, 2001 3:13 PM
To: 'Roger L. Costello'; xmlschema-dev@w3.org
Subject: RE: Error in Primer? ... xpath expressions in keys


Hi Roger,

<snip/>

> 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.


<snip/>
>
> 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


Priscilla Walmsley
Vitria Technology

Received on Wednesday, 22 August 2001 05:41:33 UTC