Advertisement
Guest User

xsd Schema

a guest
May 18th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.46 KB | None | 0 0
  1. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org/po.xsd"
  2. xmlns="http://tempuri.org/po.xsd" elementFormDefault="qualified">
  3.  <xs:annotation>
  4.   <xs:documentation xml:lang="en">
  5.    Purchase order schema for Example.com.
  6.    Copyright 2000 Example.com. All rights reserved.
  7.   </xs:documentation>
  8.  </xs:annotation>
  9.  
  10.  <xs:element name="purchaseOrder" type="PurchaseOrderType"/>
  11.  
  12.  <xs:element name="comment" type="xs:string"/>
  13.  
  14.  <xs:complexType name="PurchaseOrderType">
  15.   <xs:sequence>
  16.    <xs:element name="shipTo" type="USAddress"/>
  17.    <xs:element name="billTo" type="USAddress"/>
  18.    <xs:element ref="comment" minOccurs="0"/>
  19.    <xs:element name="items"  type="Items"/>
  20.   </xs:sequence>
  21.   <xs:attribute name="orderDate" type="xs:date"/>
  22.  </xs:complexType>
  23.  
  24.  <xs:complexType name="USAddress">
  25.       <xs:annotation>
  26.       <xs:documentation>
  27.        Purchase order schema for Example.Microsoft.com.
  28.        Copyright 2001 Example.Microsoft.com. All rights reserved.
  29.       </xs:documentation>
  30.       <xs:appinfo>
  31.         Application info.
  32.       </xs:appinfo>
  33.      </xs:annotation>
  34.  
  35.   <xs:sequence>
  36.    <xs:element name="name"   type="xs:string"/>
  37.    <xs:element name="street" type="xs:string"/>
  38.    <xs:element name="city"   type="xs:string"/>
  39.    <xs:element name="state"  type="xs:string"/>
  40.    <xs:element name="zip"    type="xs:decimal"/>
  41.   </xs:sequence>
  42.   <xs:attribute name="country" type="xs:NMTOKEN"
  43.     fixed="US"/>
  44.  </xs:complexType>
  45.  
  46.  <xs:complexType name="Items">
  47.   <xs:sequence>
  48.    <xs:element name="item" minOccurs="0" maxOccurs="unbounded">
  49.     <xs:complexType>
  50.      <xs:sequence>
  51.       <xs:element name="productName" type="xs:string"/>
  52.       <xs:element name="quantity">
  53.        <xs:simpleType>
  54.         <xs:restriction base="xs:positiveInteger">
  55.          <xs:maxExclusive value="100"/>
  56.         </xs:restriction>
  57.        </xs:simpleType>
  58.       </xs:element>
  59.       <xs:element name="USPrice"    type="xs:decimal"/>
  60.       <xs:element ref="comment"   minOccurs="0"/>
  61.       <xs:element name="shipDate" type="xs:date" minOccurs="0"/>
  62.      </xs:sequence>
  63.      <xs:attribute name="partNum" type="SKU" use="required"/>
  64.     </xs:complexType>
  65.    </xs:element>
  66.   </xs:sequence>
  67.  </xs:complexType>
  68.  
  69.  <!-- Stock Keeping Unit, a code for identifying products -->
  70.  <xs:simpleType name="SKU">
  71.   <xs:restriction base="xs:string">
  72.    <xs:pattern value="\d{3}-[A-Z]{2}"/>
  73.   </xs:restriction>
  74.  </xs:simpleType>
  75.  
  76. </xs:schema>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement