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

Re: Keyref not working in MSXML4 - is it correct?

From: Eddie Robertsson <eddie@allette.com.au>
Date: Wed, 12 Dec 2001 10:43:11 +1100
Message-ID: <3C169A0F.FC30CAD3@allette.com.au>
To: Kevin Burges <xmldude@burieddreams.com>
CC: Jeni Tennison <jeni@jenitennison.com>, xmlschema-dev@w3.org
Hi Kevin,

> This change did indeed fix the problem, but it doesn't look to me like
> it should work. Given that this Keyref is defined INSIDE the <Root>
> element, surely the selector should not itself contain "Root". The Key
> element in my example does not have "Root" in it and it works OK. Can
> you confirm that I should not need "Root/Form" but simply "Form",
> given that this is defined inside <Root>?

Jeni is correct. You shouldn't specify the Root element in the selector xpath.
I've experienced this problem with MSXML4 before and I've found that the problem
actually is with the types xs:ID and xs:IDREF.
I saw that you used these in your document as the types for the attributes ID and
FormID and that's what's causing the problem. Do you really need to use xs:ID and
xs:IDREF or can you just use xs:string? Since you define a key and keyref you
don't need to define the attributes with xs:ID and xs:IDREF. If you change the
types of the attributes to xs:string everything should validate fine.
I'll submit a bug report on this to MSXML4.

> Just out of interest I tried "./Form" which also works fine and makes
> sense, but "Root/Form" does not. To me, "./Form" says exactly the same
> thing as "Form".

Your correct. Form and ./Form are equivalent and correct in this case, while
Root/Form is not correct.

Received on Tuesday, 11 December 2001 18:33:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC