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

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.

Cheers,
/Eddie

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