Skip to content

Instantly share code, notes, and snippets.

@mwfrost
Created February 9, 2011 22:01
Show Gist options
  • Select an option

  • Save mwfrost/819399 to your computer and use it in GitHub Desktop.

Select an option

Save mwfrost/819399 to your computer and use it in GitHub Desktop.
Sample schema
<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="comment" type="xsd:string">
<xsd:annotation>
<xsd:documentation>doc for comment</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="USAddress">
<xsd:annotation>
<xsd:documentation>doc for USAddress</xsd:documentation>
</xsd:annotation>
<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"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
<!-- Stock Keeping Unit, a code for identifying products -->
<xsd:simpleType name="SKU">
<xsd:annotation>
<xsd:documentation>doc for SKU</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment