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

Re: key/keyref problem

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Mon, 02 Jul 2001 19:43:24 +0200
Message-ID: <3B40B2BC.9CB1DD39@dyomedea.com>
To: "WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)" <adam_watkin-jones@hp.com>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>


"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 13:43:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT