XML Page 1 Documentation
(This file is called "XMLPage1documentation.html".)

XML Schema
<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:annotation> <xsd:documentation> Declaring all the simple type for pattern restriction and list of values using enumeration </xsd:documentation> </xsd:annotation> <!-- =========================== | S i m p l e T y p e | =========================== --> <!-- define customer number pattern --> <xsd:simpleType name="custNo"> <xsd:restriction base="xsd:ID"> <xsd:pattern value="C[0-9]{3}"/> </xsd:restriction> </xsd:simpleType> <!-- enumerate state possibility --> <xsd:simpleType name="OZstate"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="NT"/> <xsd:enumeration value="SA"/> <xsd:enumeration value="WA"/> <xsd:enumeration value="ACT"/> <xsd:enumeration value="NSW"/> <xsd:enumeration value="TAS"/> <xsd:enumeration value="QLD"/> <xsd:enumeration value="VIC"/> </xsd:restriction> </xsd:simpleType> <!-- define postcode number pattern --> <xsd:simpleType name="postC"> <xsd:restriction base="xsd:integer"> <xsd:maxInclusive value="7999"/> <xsd:minInclusive value="2000"/> <xsd:pattern value="[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> <!-- define office and home phone number pattern --> <xsd:simpleType name="bContact"> <xsd:restriction base="xsd:string"> <xsd:pattern value="\([0-9]{2}\) [0-9]{4}\-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> <!-- define item number pattern --> <xsd:simpleType name="itemCode"> <xsd:restriction base="xsd:string"> <xsd:pattern value="I[0-9]{3}"/> </xsd:restriction> </xsd:simpleType> <!-- define order number pattern --> <xsd:simpleType name="orderNo"> <xsd:restriction base="xsd:string"> <xsd:pattern value="O[0-9]{3}"/> </xsd:restriction> </xsd:simpleType> <xsd:annotation> <xsd:documentation> Declaring complex type, which are used in contact and customer name </xsd:documentation> </xsd:annotation> <!-- ============================= | C o m p l e x T y p e | ============================= --> <xsd:complexType name="tContact1"> <xsd:simpleContent> <xsd:extension base="bContact"> <xsd:attribute name="primary" use="optional"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="tContact2"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute name="primary" use="optional"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="customerName"> <xsd:choice> <xsd:sequence> <xsd:element ref="givenName" minOccurs="1" maxOccurs="unbounded"/> <xsd:element ref="familyName" minOccurs="1" maxOccurs="1"/> </xsd:sequence> <xsd:sequence> <xsd:element ref="companyName" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:choice> </xsd:complexType> <xsd:annotation> <xsd:documentation> List of basic elements which are declared using simple data type </xsd:documentation> </xsd:annotation> <!-- ============================= | B a s i c Elements | ============================= --> <xsd:element name="givenName" type="xsd:string"/> <xsd:element name="familyName" type="xsd:string"/> <xsd:element name="companyName" type="xsd:string"/> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="suburb" type="xsd:string"/> <xsd:element name="description" type="xsd:string"/> <xsd:element name="quantity" type="xsd:decimal"/> <xsd:element name="unitPrice" type="xsd:decimal"/> <xsd:element name="discount" type="xsd:integer"/> <xsd:element name="orderDate" type="xsd:date"/> <xsd:annotation> <xsd:documentation> Composing the customer and order element </xsd:documentation> </xsd:annotation> <!-- ============================= | O r d e r element | ============================= --> <xsd:element name="orders"> <xsd:complexType> <xsd:sequence> <xsd:element ref="order" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="order"> <xsd:complexType> <xsd:sequence> <xsd:element ref="orderDate" minOccurs="1" maxOccurs="1"/> <xsd:element ref="orderLine" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="no" type="orderNo" use="required"/> </xsd:complexType> </xsd:element> <xsd:element name="orderLine"> <xsd:complexType> <xsd:sequence> <xsd:element name="itemNo" type="itemCode" minOccurs="1" maxOccurs="1"/> <xsd:element ref="description" minOccurs="1" maxOccurs="1"/> <xsd:element ref="quantity" minOccurs="1" maxOccurs="1"/> <xsd:element ref="unitPrice" minOccurs="1" maxOccurs="1"/> <xsd:element ref="discount" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- ============================= | Customer element | ============================= --> <xsd:element name="customer"> <xsd:complexType> <xsd:sequence> <xsd:element name="name" type="customerName" minOccurs="1" maxOccurs="1"/> <xsd:element ref="address" minOccurs="1" maxOccurs="1"/> <xsd:element ref="contacts" minOccurs="1" maxOccurs="1"/> <xsd:element ref="orders" minOccurs="0" maxOccurs="1"/> </xsd:sequence> <xsd:attribute name="cno" type="custNo"/> <xsd:attribute name="corporate" type="xsd:boolean" use="optional"/> </xsd:complexType> </xsd:element> <xsd:element name="address"> <xsd:complexType> <xsd:sequence> <xsd:element ref="street" minOccurs="1" maxOccurs="1"/> <xsd:element ref="suburb" minOccurs="1" maxOccurs="1"/> <xsd:element name="state" type="OZstate" minOccurs="1" maxOccurs="1"/> <xsd:element name="postcode" type="postC" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="contacts"> <xsd:complexType> <xsd:sequence> <xsd:element ref="name" minOccurs="0" maxOccurs="1"/> <xsd:element name="home" type="tContact1" minOccurs="0" maxOccurs="1"/> <xsd:element name="office" type="tContact1" minOccurs="0" maxOccurs="1"/> <xsd:element name="mobile" type="tContact2" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- =========================== | R o o t Element | =========================== --> <xsd:element name="customers"> <xsd:complexType> <xsd:sequence> <xsd:element ref="customer" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

Modified XML Document
<?xml version="1.0"?> <customers xsi:noNamespaceSchemaLocation="customers.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <customer cno="C111" corporate="false"> <name> <givenName>James</givenName> <familyName>Hird</familyName> </name> <address> <street>12 Raleigh Rd</street> <suburb>North Melbourne</suburb> <state>VIC</state> <postcode>3611</postcode> </address> <contacts> <home>(03) 9903-3401</home> <office>(03) 9903-3401</office> <mobile primary="true">04111222333</mobile> </contacts> </customer> <customer cno="C222" corporate="true"> <name> <companyName>Essendon Football Club</companyName> </name> <address> <street>10 Bomber Ave</street> <suburb>Windy Hill</suburb> <state>VIC</state> <postcode>3666</postcode> </address> <contacts> <name>Ray Horsburgh</name> <office primary="true">(03) 9111-9999</office> <mobile>04111222444</mobile> </contacts> <orders> <order no="O112"> <orderDate>2007-06-21</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>100</quantity> <unitPrice>1.50</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Victoria Bitter</description> <quantity>200</quantity> <unitPrice>3</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O121"> <orderDate>2006-01-20</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Coke</description> <quantity>25</quantity> <unitPrice>1.20</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O111"> <orderDate>2007-04-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>100</quantity> <unitPrice>1</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Meat Pies</description> <quantity>100</quantity> <unitPrice>2</unitPrice> <discount>10</discount> </orderLine> </order> </orders> </customer> <customer cno="C333" corporate="false"> <name> <givenName>Kevin</givenName> <familyName>Sheedy</familyName> </name> <address> <street>10 High St</street> <suburb>Essendon</suburb> <state>VIC</state> <postcode>3622</postcode> </address> <contacts> <home>(03) 9111-3333</home> <office>(03) 9111-9999</office> <mobile primary="true">04111222444</mobile> </contacts> <orders> <order no="O113"> <orderDate>2006-01-21</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>1500</quantity> <unitPrice>1</unitPrice> <discount>20</discount> </orderLine> </order> <order no="O114"> <orderDate>2007-07-10</orderDate> <orderLine> <itemNo>I002</itemNo> <description>Meat Pies</description> <quantity>2000</quantity> <unitPrice>2</unitPrice> <discount>20</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Orange Juice</description> <quantity>1000</quantity> <unitPrice>1.50</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O122"> <orderDate>2007-01-01</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Red Wine</description> <quantity>1500</quantity> <unitPrice>15</unitPrice> <discount>20</discount> </orderLine> </order> <order no="O115"> <orderDate>2007-07-11</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Victoria Bitter</description> <quantity>2000</quantity> <unitPrice>3</unitPrice> <discount>10</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Red Wine</description> <quantity>200</quantity> <unitPrice>15</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>500</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I004</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I005</itemNo> <description>Salmon Sandwich</description> <quantity>500</quantity> <unitPrice>3</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I006</itemNo> <description>Springroll</description> <quantity>1000</quantity> <unitPrice>0.5</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I007</itemNo> <description>White Wine</description> <quantity>500</quantity> <unitPrice>12</unitPrice> <discount>5</discount> </orderLine> </order> </orders> </customer> <customer cno="C444" corporate="false"> <name> <givenName>John</givenName> <familyName>Worsfold</familyName> </name> <address> <street>23 Bayview Ave</street> <suburb>South Perth</suburb> <state>WA</state> <postcode>6200</postcode> </address> <contacts> <home>(06) 6222-3333</home> <office>(06) 6222-9999</office> <mobile primary="true">04111222555</mobile> </contacts> <orders> <order no="O116"> <orderDate>2007-12-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>30</quantity> <unitPrice>1.50</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Red Wine</description> <quantity>5</quantity> <unitPrice>15</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> <order no="O117"> <orderDate>2007-06-16</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> <order no="O123"> <orderDate>2007-06-17</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> <customer cno="C555" corporate="false"> <name> <givenName>Ben</givenName> <familyName>Cousins</familyName> </name> <address> <street>23 Long Ave</street> <suburb>West Perth</suburb> <state>WA</state> <postcode>6500</postcode> </address> <contacts> <home>(06) 6222-4444</home> <office>(06) 6222-9999</office> <mobile primary="true">04111222666</mobile> </contacts> <orders> <order no="O120"> <orderDate>2007-05-05</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>15</quantity> <unitPrice>1</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> <customer cno="C666" corporate="true"> <name> <companyName>West Coast Football Club</companyName> </name> <address> <street>1 Eagle Dr</street> <suburb>Subiaco</suburb> <state>WA</state> <postcode>6666</postcode> </address> <contacts> <name>Dalton Gooding</name> <office primary="true">(06) 6222-9999</office> <mobile>04111222555</mobile> </contacts> <orders> <order no="O118"> <orderDate>2007-04-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>1000</quantity> <unitPrice>1.50</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>500</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I004</itemNo> <description>Salmon Sandwich</description> <quantity>500</quantity> <unitPrice>3</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I005</itemNo> <description>Springroll</description> <quantity>1000</quantity> <unitPrice>0.5</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I006</itemNo> <description>Rice Paper Roll</description> <quantity>1000</quantity> <unitPrice>1.5</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I007</itemNo> <description>BBQ Chicken Wing</description> <quantity>1500</quantity> <unitPrice>0.75</unitPrice> <discount>2</discount> </orderLine> </order> <order no="O119"> <orderDate>2007-07-01</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Coke</description> <quantity>500</quantity> <unitPrice>1.2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Lemonade</description> <quantity>500</quantity> <unitPrice>1.5</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> </customers>

XMLfile.jpg 200x30

schemafile.jpg 200x30