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

RE: key/keyref problem

From: WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1) <adam_watkin-jones@hp.com>
Date: Mon, 2 Jul 2001 19:01:02 +0100
Message-ID: <72FAAE98015DD511B42600D0B747AC7FC1208C@kipling.br.itc.hp.com>
To: "'vdv@dyomedea.com'" <vdv@dyomedea.com>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi Eric,

Thanks for your reply.  Removing the namespace prefix in the refer attribute
does the trick.

I also have been scouring the rec for guidance and it does indeed specify
QName for refer.  The example in the primer also used a namespace prefix.
So, I have the same confusion as you.  Maybe there is someone out there who
could enlighten us!

Thanks again,

-----Original Message-----
From: Eric van der Vlist [mailto:vdv@dyomedea.com]
Sent: 02 July 2001 18:43
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
> 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:

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

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.

See you at XTech in San Diego.
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:01:53 UTC

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