RE: key/keyref problem

Hello,

You are correct that it should be a QName.  I suspect it was a bug in a
previous version of XSV because the current on-line version of XSV does not
consider it an error.

To answer your question about why it is a QName, the key and keyref
definitions do _not_ have to be defined side by side in the same scoping
element.  The scoping element of the key can be a child of the scoping
element of the keyref.  That child may be in a different namespace.

In this example, mykey could have been defined in the declaration of keys,
and dummy1 could have been defined in the declaration of root.


Hope that helps!

Priscilla Walmsley
Vitria Technology

-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Eric van der Vlist
Sent: Monday, July 02, 2001 1:43 PM
To: WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)
Cc: 'xmlschema-dev@w3.org'
Subject: Re: key/keyref problem




"WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)" wrote:
>
> Hello,
>
> My head is sore from bashing it against a brick wall so I hope someone can
> help me with this!

I think I can :=) at least to point a couple of issues...

>
> Below is some XML, a schema and the output from XSV when I try to
validate.
>
> I am trying to express a key/keyref constraint but I always get an XSV
> error.  I have tried altering the position of the xsd:keyref and xsd:key
> elements in case it is some sort of scoping problem but with no success.

Your scoping is good and I suspect a more trivial reason!

.../...

> <xsd:key name="mykey">
> <xsd:selector xpath="k1:keys/k1:key"/>
> <xsd:field xpath="@id"/>
> </xsd:key>
>
> <xsd:keyref name="dummy1" refer="k1:mykey">

If I change this to:

<xsd:keyref name="dummy1" refer="mykey">

XSV doesn't complain any longer.

Now, what's weird is that the rec mentions refer as a QName:

<keyref
 id = ID
 name = NCName
 refer = QName
 {any attributes with non-schema namespace . . .}>
 Content: (annotation?, (selector, field+))
</keyref>

OTH, since key and keyrefs need to be defined side by side in the same
element, I wonder what is the reason for allowing a QName here since I
don't see how you could refer a key defined for another namespace.

The rec also says that the refer should be QName resolved and my bet
would be that you are right and that it's a SCV bug.

I am still confused, though ;) ...

Hope this helps.

Eric
--
See you at XTech in San Diego.
             http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Monday, 2 July 2001 14:37:59 UTC