Commit da60345c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-11-29 11:05:34 by szach] added tests for list derivation, union...

[r2003-11-29 11:05:34 by szach] added tests for list derivation, union derivation and targetNamespace

Original author: szach
Date: 2003-11-29 11:05:34+00:00
parent fd66393f
<foo>true 12 false false 24 13 false</foo>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="foo" type="bool_or_int_list"/>
<xsd:simpleType name="bool_or_int">
<xsd:union memberTypes="xsd:boolean xsd:integer" />
</xsd:simpleType>
<xsd:simpleType name="bool_or_int_list">
<xsd:list itemType="bool_or_int" />
</xsd:simpleType>
<xsd:simpleType name="string_list">
<xsd:list itemType="xsd:string" />
</xsd:simpleType>
</xsd:schema>
<mails xmlns="http://www.cduce.org/2003/tests/mails">
<mail id="0">
<envelope>
<From>user@unknown.domain.org</From>
<To>user@cduce.org</To>
<Date>2003-10-15T15:44:01Z</Date>
<Subject>I desperately need XML Schema support in CDuce</Subject>
<header name="Reply-To">bill@microsoft.com</header>
</envelope>
<body>
As subject says, is it possible to implement it?
</body>
</mail>
<mail id="1">
<envelope>
<From>zack@di.ens.fr</From>
<To>bill@microsoft.com</To>
<Date>2003-10-15T16:17:39Z</Date>
<Subject>Re: I desperately need XML Schema support in CDuce</Subject>
</envelope>
<body>
user@unknown.domain.org wrote:
> As subject says, is possible to implement it?
Sure, I'm working on it, in a few years^Wdays it will be finished
</body>
</mail>
</mails>
<xsd:schema
targetNamespace="http://www.cduce.org/2003/tests/mails"
xmlns:cd="http://www.cduce.org/2003/tests/mails"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:element name="mails" type="cd:mailsType"/>
<xsd:complexType name="mailsType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="mail" type="cd:mailType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="mailType">
<xsd:sequence>
<xsd:element name="envelope" type="cd:envelopeType"/>
<xsd:element name="body" type="cd:bodyType"/>
</xsd:sequence>
<xsd:attribute use="required" name="id" type="xsd:integer"/>
</xsd:complexType>
<xsd:complexType name="envelopeType">
<xsd:sequence>
<xsd:element name="From" type="xsd:string"/>
<xsd:element name="To" type="xsd:string"/>
<xsd:element name="Date" type="xsd:dateTime"/>
<xsd:element name="Subject" type="xsd:string"/>
<xsd:element name="header" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="bodyType">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="foo" type="fooType"/>
<xsd:simpleType name="fooType">
<xsd:union memberTypes="xsd:integer xsd:string"/>
</xsd:simpleType>
</xsd:schema>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment