W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2000


From: Norman Walsh <ndw@nwalsh.com>
Date: 12 Oct 2000 09:16:27 -0400
To: xmlschema-dev@w3.org
Message-ID: <87k8be5hec.fsf@nwalsh.com>
More user error, I'm sure. :-/

I want to constrain the ID/IDREF relationship between two elements so
that the IDREF part can only point to specific elements. In this case,
I want to assert that <wfc def="foo"> can only point to <wfcnote id="foo">.

So, in the element declaration for the root element, I define a key:

<element name='spec' type='spec:spec'>
  <key name="wfcNoteKey">
    <selector xpath="//wfcnote[@id]"/>
    <field xpath="@id"/>

And in the element declaration for the wfc, I make a keyref:

<element name='wfc' type='spec:wfc'>
  <keyref name="wfcNoteRef" refer="wfcNoteKey">
    <selector xpath="@def"/>
    <field xpath="@def"/>

XSV complains:

  No key or unique constraint named wfcNoteKey declared, refed by keyref

at every occurance of <wfc def="foo">...</wfc> in my test document.
I didn't expect to get it right without a bit of tinkering, but I'm
stymied by the 'undeclared' message. I'm an idiot today, because...?

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | The trip doesn't exist that can set you
http://nwalsh.com/            | beyond the reach of cravings, fits of
                              | temper, or fears. If it did, the human
                              | race would be off there in a
                              | body.--Seneca
Received on Thursday, 12 October 2000 09:18:34 UTC

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