Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


ID and IDREF Files

From: "geoff" <nospam@------.--->
To: NULL
Date: 12/2/2007 2:44:00 PM

This is how the book has the files (3 of them) but xml notepad says shipTo 
has to be filled out, I hate it when book examples do not work :(


======== INVOICE.XML ==========

<?xml version="1.0" encoding="UTF-8"?>
<invoice:invoice xmlns:invoice="http://www.skatestown.com/ns/invoice"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.skatestown.com/ns/invoice
                       ./invoice.xsd"
   id="43871" submitted="2004-01-05" customerId="73852">
   <billTo id="addr-1">
      <company>The Skateboard Warehouse</company>
      <street>One Warehouse Park</street>
      <street>Building 17</street>
      <city>Boston</city>
      <state>MA</state>
      <postalCode>01775</postalCode>
   </billTo>
   <shipTo href="addr-1"/>
   <order>
      <item sku="318-BP" quantity="5" unitPrice="49.95">
         <description>Skateboard backpack; five pockets</description>
      </item>
      <item sku="947-TI" quantity="12" unitPrice="129.00">
         <description>Street-style titanium skateboard.</description>
      </item>
      <item sku="008-PR" quantity="1000" unitPrice="0.00">
         <description>Promotional: SkatesTown stickers</description>
      </item>
   </order>
   <tax>89.89</tax>
   <shippingAndHandling>200</shippingAndHandling>
   <totalCost>2087.64</totalCost>
</invoice:invoice>



======== INVOICE.XSD ==========

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema
    targetNamespace="http://www.skatestown.com/ns/invoice"
    xmlns:po="http://www.skatestown.com/ns/po"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.skatestown.com/ns/invoice">

 <xsd:import namespace="http://www.skatestown.com/ns/po" 
schemaLocation="./po.xsd" />
 <xsd:annotation>
  <xsd:documentation xml:lang="en">
         Invoice schema for SkatesTown.
  </xsd:documentation>
 </xsd:annotation>
 <xsd:element name="invoice" type="invoiceType" />
 <xsd:complexType name="invoiceType">
  <xsd:sequence>
   <xsd:element name="billTo" type="po:addressType" />
   <xsd:element name="shipTo" type="po:addressType" />
   <xsd:element name="order">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="item" type="itemType" maxOccurs="unbounded" />
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="tax" type="priceType" />
   <xsd:element name="shippingAndHandling" type="priceType" />
   <xsd:element name="totalCost" type="priceType" />
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:positiveInteger" use="required" />
  <xsd:attribute name="submitted" type="xsd:date" use="required" />
  <xsd:attribute name="customerId" type="xsd:positiveInteger" use="required" 
/>
 </xsd:complexType>
 <xsd:complexType name="itemType">
  <xsd:complexContent>
   <xsd:extension base="po:itemType">
    <xsd:attribute name="unitPrice" type="priceType" use="required" />
   </xsd:extension>
  </xsd:complexContent>
 </xsd:complexType>
 <xsd:simpleType name="priceType">
  <xsd:restriction base="xsd:decimal">
   <xsd:minInclusive value="0" />
  </xsd:restriction>
 </xsd:simpleType>
</xsd:schema>


========== PO.XSD =========

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://www.skatestown.com/ns/po" 
targetNamespace="http://www.skatestown.com/ns/po" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:annotation>
  <xsd:documentation xml:lang="en">
   Purchase order schema for SkatesTown.
  </xsd:documentation>
 </xsd:annotation>
 <xsd:element name="po" type="poType" />
 <xsd:complexType name="poType">
  <xsd:sequence>
   <xsd:element name="billTo" type="addressType" />
   <xsd:element name="shipTo" type="addressType" />
   <xsd:element name="order">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="item" type="itemType" maxOccurs="unbounded" />
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
  <xsd:attribute name="id" use="required" type="xsd:positiveInteger" />
  <xsd:attribute name="submitted" use="required" type="xsd:date" />
  <xsd:attribute name="customerId" use="required" type="xsd:positiveInteger" 
/>
 </xsd:complexType>
 <xsd:complexType name="addressType">
  <xsd:sequence>
   <xsd:element name="name" type="xsd:string" minOccurs="0" />
   <xsd:element name="company" type="xsd:string" minOccurs="0" />
   <xsd:element name="street" type="xsd:string" maxOccurs="unbounded" />
   <xsd:element name="city" type="xsd:string" />
   <xsd:element name="state" type="xsd:string" minOccurs="0" />
   <xsd:element name="postalCode" type="xsd:string" minOccurs="0" />
   <xsd:element name="country" type="xsd:string" minOccurs="0" />
  </xsd:sequence>
  <xsd:attribute name="id" type="xsd:ID" />
  <xsd:attribute name="href" type="xsd:IDREF" />
 </xsd:complexType>
 <xsd:complexType name="itemType">
  <xsd:sequence>
   <xsd:element name="description" type="xsd:string" minOccurs="0" />
  </xsd:sequence>
  <xsd:attribute name="sku" use="required">
   <xsd:simpleType>
    <xsd:restriction base="xsd:string">
     <xsd:pattern value="\d{3}-[A-Z]{2}" />
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="quantity" use="required" type="xsd:positiveInteger" 
/>
 </xsd:complexType>
</xsd:schema>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent