spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / authoring / languages / xml / schemas / chap1 / 4 To page 1current pageTo page 3To page 4
[previous] [next]

Professional XML Schemas

Finance Developer (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume
Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans


Now let's see the schema that we use for our Delivery Receipt documents. The schema is called DeliveryReceipt.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
   <xs:element name = "DeliveryReceipt">
      <xs:complexType>
         <xs:sequence>

            <xs:element name = "Customer">
               <xs:complexType>
                  <xs:sequence>
                     <xs:element ref = "Name" />
                     <xs:element ref = "Address" />
                  </xs:sequence>
               </xs:complexType>
            </xs:element>

            <xs:element name = "Items">
               <xs:complexType>
                  <xs:sequence>
                     <xs:element ref = "DeliveryItem" 
                                 minOccurs = "1" maxOccurs = "unbounded"/>
                  </xs:sequence>
               </xs:complexType>
            </xs:element>

         </xs:sequence>
         <xs:attribute name = "deliveryID" type = "xs:integer" />
         <xs:attribute name = "dateReceived" type = "xs:date" />
      </xs:complexType>
   </xs:element>

   <xs:element name = "Name">
      <xs:complexType>
         <xs:sequence>
            <xs:element name = "FirstName" type = "xs:string" />
            <xs:element name = "MiddleInitial" type = "xs:string" 
                                 minOccurs = "0" maxOccurs = "1" />
            <xs:element name = "LastName" type = "xs:string" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>

   <xs:element name = "Address">
      <xs:complexType>
         <xs:sequence>
            <xs:element name = "AddressLine1"  type = "xs:string" />
            <xs:element name = "AddressLine2" type = "xs:string" 
                        minOccurs = "0" maxOccurs = "1" />
            <xs:element name = "Town" type = "xs:string" />
            <xs:element name = "City" type = "xs:string" 
                        minOccurs = "0" maxOccurs = "1" />
            <xs:element name = "StateProvinceCounty" type = "xs:string" />
            <xs:element name = "ZipPostCode"  type = "xs:string" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>

   <xs:element name = "DeliveryItem">
      <xs:complexType>
         <xs:sequence>
            <xs:element name = "Description"  type = "xs:string" />
         </xs:sequence>
         <xs:attribute name = "quantity" type = "xs:integer" />
      </xs:complexType>
   </xs:element>

</xs:schema>

There are a few things we should note about this schema:


home / authoring / languages / xml / schemas / chap1 / 4 To page 1current pageTo page 3To page 4
[previous] [next]


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger

Created: October 30, 2001
Revised: October 30, 2001


URL: http://webreference.com/authoring/languages/xml/schemas/chap1/4/2.html