Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] XML schema : refer problem

From: Geert Delanote <geert.delanote@-----.--->
To: Michael Kay <mike@--------.--->
Date: 4/22/2009 3:06:00 PM
Tnx. I need to study (assertions in) xml schema 1.1 ;)
Does the assertion below state that every question of the poll must be answered?

How do I change
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" version="1.0" >
so that it refers to xsd 1.1?
Does XMLSpy support xsd 1.1?
Do parsers validate against xsd 1.1?

Google couldn't answer me (or I asked it the wrong questions ;))...


On Wed, Apr 22, 2009 at 3:57 PM, Michael Kay <mike@s...> wrote:
>
> Easy enough in XSD 1.1 (*)
>
> On organisationType, define
>
> xs:assert test="every $pp in ./person/poll satisfies
>                 some $p in ./poll satisfies
>                    ($pp/@id = $p/@id
>                      and every $a in $pp/answer satisfies $a/@id =
> $p/question/@id)"
>
> (*) Also easy to get it wrong - no guarantees offered!
>
> Michael Kay
> http://www.saxonica.com/
>
>> -----Original Message-----
>> From: Geert Delanote [mailto:geert.delanote@g...]
>> Sent: 22 April 2009 14:13
>> To: xml-dev@l...
>> Subject: [xml-dev] XML schema : refer problem
>>
>> Suppose I have the following document :
>> <?xml version="1.0" encoding="UTF-8"?>
>> <organisation>
>>       <person id="1">
>>               <poll id="a">
>>                       <answer id="1"/>
>>                       <answer id="3"/>
>>               </poll>
>>       </person>
>>
>>       <poll id="a">
>>               <question id="1"/>
>>               <question id="2"/>
>>       </poll>
>>       <poll id="b">
>>               <question id="1"/>
>>               <question id="3"/>
>>       </poll>
>> </organisation>
>>
>> In my schema definition i want the following constraints :
>> - a poll has a unique id within an organisation : key on id
>> in organisation scope : No Problem
>> - a question has a unique id within a poll : key on id in poll scope :
>> No Problem
>> - a person can only answer a defined poll : keyref to the key of poll
>> : No problem
>> - a person can only answer questions of the referenced poll : ...
>> problem ... How do I do that? The combination poll-id
>> question-id is unique but I can't define a key on that
>> combination which I need to refer to.
>>
>> Extra question : how can I ensure that the person answers
>> every question?
>> The question element contains lots of information that I
>> don't want to duplicate...
>>
>> ______________________________________________________________
>> _________
>>
>> XML-DEV is a publicly archived, unmoderated list hosted by
>> OASIS to support XML implementation and development. To
>> minimize spam in the archives, you must subscribe before posting.
>>
>> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> Or unsubscribe: xml-dev-unsubscribe@l...
>> subscribe: xml-dev-subscribe@l... List archive:
>> http://lists.xml.org/archives/xml-dev/
>> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>>
>
>

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent