RE: key/keyref problem

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,
Adam


-----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
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:01:53 UTC