[
Lists Home |
Date Index |
Thread Index
]
Le mercredi 21 juin 2006 à 05:52 -0400, Frank Richards a écrit :
> Marielou wrote:
> > Is it possible to have unrestricted order and
> > unrestricted cardinality? the options <all> <sequence>
> > and <choice> dont make this easy. I have implemented
> > my schema using <sequence> to enable me to achieve the
> > unrestricted cardinality I require but this is not
> > what I need as each XML I am validating has a
> > different order. Is there some pattern i can use in my
> > schema to combine elements to achieve unrestricted
> > order and unrestricted cardinality? is there some
> > (probably )complex design which could get round the
> > limitations? please help! even if the answer is a
> > known "no this is most definately not possible with
> > the restrictions on XML schema please confirm!"
> >
> >
> I suppose it's cheating to suggest using a DTD:
>
> <!ELEMENT foo (bar | baz )*>
Which in W3C XML Schema is spelled:
<xs:element name="foo">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="bar"/>
<xs:element ref="baz"/>
</xs:choice>
</xs:complexType>
</xs:element>
Eric
--
GPG-PGP: 2A528005
Have you ever thought about unit testing XSLT templates?
http://xsltunit.org
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
|