🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #179

Re: Type complexe avec minimum 1 enfant, mais en acceptant plusieurs

#179
From: Mayeul
Date: Thu, 21 Apr 2011 14:29
28 lines
2249 bytes
La seule mani�re de le faire en XML Schema 1.0 est d'�noncer, soi-m�me, 
toutes les combinaisons autoris�es, et de faire un xs:choice permettant 
au choix chacune d'entre elles.

<xs:choice>
   <xs:sequence>
     <xs:element ref="a"/>
     <xs:element ref="b" minOccurs="0"/>
     <xs:element ref="c" minOccurs="0"/>
   </xs:sequence>
   <xs:sequence>
     <xs:element ref="b"/>
     <xs:element ref="c" minOccurs="0"/>
   </xs:sequence>
   <xs:sequence>
     <xs:element ref="c"/>
   </xs:sequence>
</xs:choice>

On ne r�p�te pas le a, puis le b, parce que XML Schema impose qu'une 
branche de <xs:choice> soit choisie sans ambigu�t�.

En XML Schema 1.1, il y a xs:assert qui permettrait de v�rifier qu'il y 
en a au moins un pr�sent, apr�s les avoir tous rendus optionnels. Mais 
bon, peu de choses le g�rant...

--
Mayeul
Technical Details
Message-ID: <4db03e31$0$17796$426a74cc@news.free.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail
References: <f550cf71-744c-4be6-8f15-4882bdf09b14@a11g2000pro.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114f60,c4b699511cfcc3b1
X-Google-NewGroupId: yes
X-Google-Attributes: gid8a75585569,domainid0,public,usenet
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail
Date: Thu, 21 Apr 2011 16:29:55 +0200
From: Mayeul <mayeul.marguet@free.fr>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
Newsgroups: fr.comp.text.xml
Subject: Re: Type complexe avec minimum 1 enfant, mais en acceptant plusieurs
References: <f550cf71-744c-4be6-8f15-4882bdf09b14@a11g2000pro.googlegroups.com>
In-Reply-To: <f550cf71-744c-4be6-8f15-4882bdf09b14@a11g2000pro.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Antivirus: avast! (VPS 110421-0, 21/04/2011), Outbound message
X-Antivirus-Status: Clean
Lines: 28
Message-ID: <4db03e31$0$17796$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 21 Apr 2011 16:24:49 CEST
NNTP-Posting-Host: 82.66.241.96
X-Trace: 1303395889 news-2.free.fr 17796 82.66.241.96:3841
X-Complaints-To: abuse@proxad.net