🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.xml
Article #10249

XML-Schema

#10249
From: Smyk
Date: Mon, 26 Jul 2010 11:32
35 lines
1389 bytes
Hej,

nie wiem jak zdefiniować schemat do następującego xml'a:

  <root>
    <sub1/>
    <sub2/>
    <sub3/>
  </root>

I teraz chodzi o to aby wystąpił co najmniej jeden z 
węzłów sub1-3 ale żeby żaden nie powtarzał się.

Na początek użyłem "choice":

  <xsd:complexType name="rootType">
    <xsd:choice maxOccurs="unbounded">
      <xsd:element name="sub1" type="xs:string"/>
      <xsd:element name="sub2" type="xs:string"/>
      <xsd:element name="sub3" type="xs:string"/>
    </xsd:choice>
  </xsd:complexType>

To mi zalatwia, że co najmniej jeden wezeł sub1-3 musi
wystąpić. Effekt uboczny - wezły mogą się powtarzać.

  <root>
    <sub1/>
    <sub1/>
  </root>

Jak temu zapobiec ?

-- 
Smyk
Technical Details
Message-ID: <8b5a2uF1hdU1@mid.uni-berlin.de>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!uni-berlin.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!uni-berlin.de!not-for-mail
From: Smyk <duzy.trzmiel@op.pl>
Newsgroups: pl.comp.xml
Subject: XML-Schema
Date: Mon, 26 Jul 2010 13:32:45 +0200
Lines: 35
Message-ID: <8b5a2uF1hdU1@mid.uni-berlin.de>
Mime-Version: 1.0
X-Trace: news.uni-berlin.de P+xwR6EgIwABN8fSYY+qNwIBsf2YQR6lcc2DvWqWZdeSS2Vbg=
User-Agent: KNode/0.10.9
X-Face: R(:|fIY+tjXY01nHXqB1CZfG~W_1BI.\B$&.h,gR0tg{!W/pOiQ~_TbsQ?9F!TGT.vHiH-8giYX|1PU@6%7_9s'Cwgn$n#VAiI?LFzJp_/XzJ<Lzpmyh}P]Zv5)sD:4QZxB_(5a3d,wg0;uP6y]Pe-B3Jau=%
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit