Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: W3C Schema for required and optional elements

From: Pavel Lepin <p.lepin@-------.--->
To: NULL
Date: 4/11/2008 11:19:00 AM


Philipp <sicsicsic@f...> wrote in
<1207843345_2873@s...>:
> I'm learning W3C Schema 1.0 and have encountered a
> problem. I want to make a complex type which requires to
> contain exactly 1 instance of each of a list of elements
> (a, b, c) and at least once a choice of several other
> elements ( d1 | d2 | d3 ). This in any order.
> 
> I have come up with the following which is (unfortunately)
> invalid XSD 1.0: <complexType name="root">
>    <all>
>      <element name="a" type="string"></element>
>      <element name="b" type="string"></element>
>      <element name="c" type="string"></element>
>      <choice maxOccurs="unbounded" minOccurs="1">
>        <element name="d1" type="string"></element>
>        <element name="d2" type="string"></element>
>        <element name="d3" type="string"></element>
>      </choice>
>    </all>
> </complexType>

W3C's schema definition language was not designed for
defining arbitrarily complex grammars. If your document
format is well-structured, expressing it in XML Schema
should be easy. If it's not, try using a more powerful
schema definition language or check validity on the
application side.

-- 
"...a Netscape engineer who shan't be named once passed a
pointer to JavaScript, stored it as a string and later
passed it back to C, killing 30..." --Blake Ross


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