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

[r2003-10-15 09:59:57 by szach] added some schema examples/tests

Original author: szach
Date: 2003-10-15 10:00:00+00:00
parent 4401bb0a
<?xml version="1.0"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for vectors and arrays.</p>
<p>This is a very preliminary draft intended more to
indicate the direction in which the editors envisage
the type library evolving than anything else. Please
send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-array.xsd,v 1.1 2003/10/15 09:59:57 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-array.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-array.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-array.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-array.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-array.xsd"/>
</xs:schema>
<?xml version='1.0'?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for a unified binary simple type.</p>
<p>This is a very preliminary draft intended more to
indicate the direction in which the editors envisage
the type library evolving than anything else. Please
send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-binary.xsd,v 1.1 2003/10/15 09:59:57 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrar-binaryy.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-binary.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-binary.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-binary.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-binary.xsd"/>
</xs:schema>
<?xml version="1.0"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for linked lists.</p>
<p>This is a very preliminary draft intended more to
indicate the direction in which the editors envisage
the type library evolving than anything else. Please
send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-list.xsd,v 1.1 2003/10/15 09:59:57 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrar-listy.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-list.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-list.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-list.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-list.xsd"/>
</xs:schema>
<?xml version="1.0"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for mathematics.</p>
<p>This is a very preliminary draft intended more to
indicate the direction in which the editors envisage
the type library evolving than anything else. Please
send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-math.xsd,v 1.1 2003/10/15 09:59:58 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrar-mathy.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-math.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-math.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-math.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-math.xsd"/>
</xs:schema>
<?xml version="1.0"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" elementFormDefault="qualified" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for measured, dimensioned quantities.</p>
<p>This is a very preliminary draft intended more to
indicate the direction in which the editors envisage
the type library evolving than anything else. Please
send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-quantity.xsd,v 1.1 2003/10/15 09:59:58 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrar-quantityy.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-quantity.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-quantity.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-quantity.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-quantity.xsd"/>
</xs:schema>
<?xml version="1.0"?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" xml:lang="EN" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>A component of the XML Schema type library:
for general text</p>
<p>This is the first draft of this component. It is expected
to persist in roughly the present form, and can be used
'as-is' or as the base type for a specialized version.
Please send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>This version has the TypeLibrary namespace --
see the included file for the actual definitions and
declarations.</p>
<p>$Id: TypeLibrary-text.xsd,v 1.1 2003/10/15 09:59:58 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning
policy, the schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrar-texty.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary-text.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary-text.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary-text.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-nn-text.xsd"/>
</xs:schema>
<?xml version='1.0'?>
<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST xs:documentation xmlns CDATA #IMPLIED>
<!ELEMENT p (#PCDATA)>
]>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/03/XMLSchema/TypeLibrary" version="1.0" xml:lang="EN">
<xs:annotation>
<xs:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>The complete XML Schema type library</p>
<p>This includes the first draft of all the separate
component which make up the library. Of these, only
XMLSchema-text.xsd should be considered to be stable and
unlikely to evolve -- see the individual component schema
documents included below for further details.
Please send suggestions for improvements to
www-xml-schema-comments@w3.org.</p>
<p>$Id: TypeLibrary.xsd,v 1.1 2003/10/15 09:59:59 szach Exp $</p>
<p>
In keeping with the XML Schema WG's standard versioning policy, the
schema document at this location, i.e.
http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd, may change
in the future, in order to remain compatible with the latest
version of XML Schema itself.</p>
<p>
Stable versions will be preserved in date space for the month
appropriate to the version of XML Schema they require. The current
set of stable versions is:
http://www.w3.org/2001/03/TypeLibrary.xsd, etc. PR of 20010316
http://www.w3.org/2001/05/TypeLibrary.xsd, etc. REC of 20010502
</p>
<p>
In other words, if the XML Schema namespace changes, the version
of this document at
http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd will change
accordingly; the stable versions listed above will not change.
</p>
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="TypeLibrary-text.xsd"/>
<xs:include schemaLocation="TypeLibrary-array.xsd"/>
<xs:include schemaLocation="TypeLibrary-list.xsd"/>
<xs:include schemaLocation="TypeLibrary-math.xsd"/>
<xs:include schemaLocation="TypeLibrary-quantity.xsd"/>
<xs:include schemaLocation="TypeLibrary-binary.xsd"/>
</xs:schema>
This diff is collapsed.
<?xml version="1.0"?>
<purchaseOrder orderDate="1999-10-20">
<shipTo country="US">
<name>Alice Smith</name>
<street>123 Maple Street</street>
<city>Mill Valley</city>
<state>CA</state>
<zip>90952</zip>
</shipTo>
<billTo country="US">
<name>Robert Smith</name>
<street>8 Oak Avenue</street>
<city>Old Town</city>
<state>PA</state>
<zip>95819</zip>
</billTo>
<comment>Hurry, my lawn is going wild!</comment>
<items>
<item partNum="872-AA">
<productName>Lawnmower</productName>
<quantity>1</quantity>
<USPrice>148.95</USPrice>
<comment>Confirm this is electric</comment>
</item>
<item partNum="926-AA">
<productName>Baby Monitor</productName>
<quantity>1</quantity>
<USPrice>39.98</USPrice>
<shipDate>1999-05-21</shipDate>
</item>
</items>
</purchaseOrder>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Purchase order schema for Example.com.
Copyright 2000 Example.com. All rights reserved.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:element name="comment" type="xsd:string"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<!-- changed by Zack since decimal isn't yet supported :-(
<xsd:element name="zip" type="xsd:decimal"/>
-->
<xsd:element name="zip" type="xsd:integer"/>
</xsd:sequence>
<!-- changed by Zack since NMTOKEN isn't yet supported :-(
<xsd:attribute name="country" type="xsd:NMTOKEN"
fixed="US"/>
-->
<xsd:attribute name="country" type="xsd:string"
fixed="US"/>
</xsd:complexType>
<xsd:complexType name="Items">
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="productName" type="xsd:string"/>
<xsd:element name="quantity">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- changed by Zack since decimal isn't yet supported :-(
<xsd:element name="USPrice" type="xsd:decimal"/>
-->
<xsd:element name="USPrice" type="xsd:integer"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="partNum" type="SKU" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Stock Keeping Unit, a code for identifying products -->
<xsd:simpleType name="SKU">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
</xsd:restriction>
</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