🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.xml
Article #10007

"Invalid value for maxOccurs (must be 0 or 1)." -- wtf?

#10007
From: Filip Rembiałkowski
Date: Tue, 30 Sep 2008 11:13
45 lines
2184 bytes
witam

chciałbym napisać xsd który zezwoli na taki xml:

::::::::::::::
owoce.xml
::::::::::::::
<skrzynka>
  <jablko/>
  <gruszka/>
  <jablko/>
</skrzynka>

skrzynka ma zawierać dowolną ilość jablek i gruszek w dowolnej kolejnosci.


myślałem że tak będzie ok:
::::::::::::::
owoce.xsd
::::::::::::::
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="skrzynka" type="skrzynka"/>
<xs:complexType name="skrzynka">
  <xs:all>
    <xs:element name="jablko" type="owoc" maxOccurs="unbounded" />
    <xs:element name="gruszka" type="owoc" maxOccurs="unbounded" />
  </xs:all>
</xs:complexType>
</xs:schema>


ale chyba czegoś nie rozumiem bo
$ xmllint --noout --schema owoce.xsd owoce.xml
owoce.xsd:6: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': Invalid value for maxOccurs (must be 0 or 1).
owoce.xsd:7: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': Invalid value for maxOccurs (must be 0 or 1).
WXS schema owoce.xsd failed to compile


co jest dla mnie dziwne: w dokumentacji na w3 (http://www.w3schools.com/Schema/el_element.asp) piszą,
 że maxOccurs może być "unbounded", a mój xmllint najwyraźniej myśli inaczej...


pomocy :)
Technical Details
Message-ID: <gbt1tf$6ed$1@nemesis.news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!newsfeed.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: Filip Rembiałkowski <plk.zuber@gmail.com>
Newsgroups: pl.comp.xml
Subject: "Invalid value for maxOccurs (must be 0 or 1)." -- wtf?
Date: Tue, 30 Sep 2008 13:13:51 +0200
Organization: TP - http://www.tp.pl/
Lines: 46
Message-ID: <gbt1tf$6ed$1@nemesis.news.neostrada.pl>
NNTP-Posting-Host: 213.77.0.70
Mime-Version: 1.0
X-Trace: nemesis.news.neostrada.pl 1222773487 6605 213.77.0.70 (30 Sep 2008 11:18:07 GMT)
X-Complaints-To: usenet@news.neostrada.pl
NNTP-Posting-Date: Tue, 30 Sep 2008 11:18:07 +0000 (UTC)
User-Agent: Icedove 1.5.0.14eol (X11/20080724)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit