Re: validation against schema: problem with key and ref attribute

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: validation against schema: problem with key and ref attribute

by kl/o';ihiL: :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christophe,
 
key and keyref work for me.
 
Since you haven't supplied any schema, its hard to see what you are doing.
 
To enable key/keyref , you need to declare constraints in the schema:
 
<xs:key name="key1">
    <xs:selector xpath="a/b/c"/>
    <xs:field xpath="@id">
<xs:key>
 
This declares an attribute .a/b/c/@... to be a key attribute.
 
<xs:keyref name="key1ref" refer="key1">
    <xs:selector xpath="d/e/f"/>
    <xs:field xpath="@subsystem"/>
</xs:keyref>
 
This declares that an attribute that matches .d/e/f/@... must have a value defined by the above key.
 
I have just tried saving a document with duplicate keys and with an invalid keyref. I got the expected error in both cases. (eXist 1.2.1).
 
Cheers
Russell Thamm


From: exist-open-bounces@... [mailto:exist-open-bounces@...] On Behalf Of geiser ch.
Sent: Tuesday, 15 July 2008 3:47 PM
To: exist-open@...
Subject: [Exist-open] validation against schema: problem with key and ref attribute

Hi all I have the impression that there is some issues re validation. So far, I cannot enforce the uniqueness of a “key”, neither can I use “ref” for an attribute. Could someone tell me what I am doing wrong? 1 – My simplified schema looks like: In this situation, an xml document like the following should not be accepted as its rule[@id] attribute is not unique. This does not seem to work (I can save the document (with validation mode = auto) or validate it against the function validate-report): a new user can create a monitoring space 1 a new user can create a monitoring space 1 2- ref If I change the line (at the end of the schema) to and add in the schema, my document would not validate. Instead, the validate-report function brings the following message: invalid http://www.e-Smile.org/entity/rule/ cvc-complex-type.3.2.2: Attribute 'id' is not allowed to appear in element 'rule'. Cheers Christophe

View this message in context: validation against schema: problem with key and ref attribute
Sent from the exist-open mailing list archive at Nabble.com.

IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email.

 

 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open