keyref attributes are mandatory?

  • Thread starter mark.van.der.voort
  • Start date
M

mark.van.der.voort

Hi,

I have defined a simple key/keyref validation for describing a tree.

<xs:key name="key_member">
<xs:selector xpath=".//member"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="ref_parent_member" refer="key_member">
<xs:selector xpath=".//member"/>
<xs:field xpath="@parentid"/>
</xs:keyref>

However, the parentid attribute is not mandatory, hence top-level
elements will not specify a parentid attribute.

This combination worked fine in XMLSPY 2004, but the exact same files
give the following error message in XMLSY 2005:

"The <keyref> identity constraint ... did not match any elements"

It disappears when at least one element has a parentid attribute.
Is it correct that a keyref constraint implies that at least one
attribute exists, and if so how would one specify a multirooted tree?

thx,

Mark van der Voort
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top