Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > keyref attributes are mandatory?

Reply
Thread Tools

keyref attributes are mandatory?

 
 
mark.van.der.voort@gmail.com
Guest
Posts: n/a
 
      03-03-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Key-keyref to attribute in root element Russell O'Connor XML 5 04-27-2004 08:32 AM
<key><keyref> does not work in XMLSpy Markus Seibold XML 0 02-13-2004 03:30 PM
XML schema - key/keyref and inheritance peterpeter XML 0 02-11-2004 01:38 PM
Can't use key and keyref with an attribute in a group J E E XML 0 11-07-2003 12:42 PM
Key/keyref validation in schema? Marek Malowidzki XML 1 08-19-2003 12:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57