XML

The Northwind Traders BizTalk Schema

In Chapter 7, we created a schema based on the W3C standard for the Northwind Traders database. This schema rewritten as a BizTalk schema is shown here.

  <Schema name="NorthwindSchema"
     xmlns="urn:schemas-microsoft-com:xml-data"
     xmlns:dt="urn:schemas-microsoft-com:datatypes">
     <ElementType name="Categories"
        xmlns:Categories="urn:northwindtraders.com.Categories"
        content="eltOnly"  model="closed">
        <group order="seq">
           <element type="Categories.CategoryID" minOccurs="1"
              maxOccurs="1" />
           <element type="Categories.CategoryName" minOccurs="1"
              maxOccurs="1" />
           <element type="Categories.Description" minOccurs="0"
              maxOccurs="1" />
           <element type="Categories.Picture" minOccurs="0"
              maxOccurs="1"/>
        </group>
     </ElementType>
     <ElementType name="Categories.CategoryID"
        xmlns:Categories="urn:northwindtraders.com.Categories"
        dt:type="integer">
        <description>
           Number automatically assigned to a new category
        </description>
     </ElementType>
     <ElementType name="Categories.CategoryName"
        xmlns:Categories="urn:northwindtraders.com.Categories"
        dt:type = "string">
        <description>Name of food category</description>
     </ElementType>
     <ElementType name="Categories.Description"
        xmlns:Categories="urn:northwindtraders.com.Categories"
        dt:type="string"/>
     <ElementType name="Categories.Picture"
        xmlns:Categories="urn:northwindtraders.com.Categories"
        dt:type = "bin.base64">
        <description>
           Picture representing the food category
         </description>
     </ElementType>
     <ElementType name="Customers"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        content="eltOnly" model="closed">
        <group order="seq">
           <element type="Customers.CustomerID" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.CompanyName" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.ContactName" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.ContactTitle" minOccurs="0"
              maxOccurs="1"/>
           <element type="Customers.Address" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.City" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.Region" minOccurs ="1"
              maxOccurs="1"/>
           <element type="Customers.PostalCode" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.Country" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.Phone" minOccurs="1"
              maxOccurs="1"/>
           <element type="Customers.Fax" minOccurs="0"
              maxOccurs="1"/>
        </group>
     </ElementType>
     <ElementType name="Customers.CustomerID"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="CustomerIDField">
        <description>
           Unique five-character code based on customer name
         </description>
     </ElementType>
     <ElementType name="Customers.CompanyName"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.ContactName"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.ContactTitle"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.Address"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string">
        <description>Street or post-office box</description>
     </ElementType>
     <ElementType name="Customers.City"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.Region"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string">
        <description>State or province</description>
     </ElementType>
     <ElementType name="Customers.PostalCode"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.Country"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string"/>
     <ElementType name="Customers.Phone"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string">
        <description>
           Phone number includes country code or area code
        </description>
     </ElementType>
     <ElementType name = "Customers.Fax"
        xmlns:Customers="urn:northwindtraders.com.Customers"
        dt:type="string">
        <description>
           Fax number includes country code or area code
        </description>
     </ElementType>
  </Schema>

As you can see, a few changes have been made between the W3C version and the BizTalk version of this schema. The annotation elements have been replaced by description elements. There is no equivalent to the W3C datatype element, nor can you set a continuous range of values (such as 1 through 100). Also, the data type content has been replaced with the content attribute.