XML

XML Data Reduced Schemas

As mentioned earlier in this chapter, BizTalk uses an XML Data Reduced schema. This schema and the schema currently defined by the W3C differ. Microsoft needed to build and release Internet Explorer 5, and it wanted to include an XML parser with Internet Explorer 5 that would work with schemas. Unfortunately, the W3C schema standard was not completed at the time Microsoft was developing Internet Explorer 5. Therefore, Microsoft used the temporary schema XDR. The XDR schema is based on a 1998 proposal to the W3C and can be found at http://www.w3.org/TR/1998/NOTE-XML-data-0105. Many similarities exist in the XDR and the W3C schemas, but there are also differences. The primary difference is that the two schemas use different keywords and XDR has less functionality.

The following code shows a sample DTD for the BizTalk schema.

  <!ENTITY % dataTypes "(bin.base64 | bin.hex | boolean | char |
     date | dateTime | dateTime.tz |fixed.14.4 | float | int |
     number | time | time.tz | i1 | i2 | i4 | r4 | r8 | ui1 | ui2 |
     ui4 |uri | uuid | entity | entities | enumeration | id | idref |
     idrefs | nmtoken | nmtokens | notation | string)">
  <!ENTITY % elementNamespace "urn:schemas-microsoft-com:xml-data">
  <!ENTITY % dataNamespace "urn:schemas-microsoft-com:datatypes">
  <!ELEMENT Schema  (AttributeType+, ElementType+, description)>
  <!ATTLIST Schema  xmlns CDATA  %elementNamespace;
                    xmlns:dt    CDATA  %dataNamespace;
                    name     CDATA  #REQUIRED >
  <!ELEMENT ElementType  (AttributeType, attribute, element+,
                           datatype, description, group)>
  <!ATTLIST ElementType  order    (one | seq | many)  many
            content  (empty | textOnly | eltOnly | mixed)  mixed
            dt:type    %dataTypes;  #IMPLIED
            model (open | closed) open
            name    ID  #REQUIRED >
  <!ELEMENT AttributeType  (datatype, description)>
  <!ATTLIST AttributeType
            name         ID   #REQUIRED
            default     CDATA  #REQUIRED
            dt:type  (entity | entities | enumeration | id | idref |
            idrefs | nmtoken | nmtokens | notation | string) #IMPLIED
            dt:values CDATA #IMPLIED
            required (yes | no) #IMPLIED >
  <!ELEMENT attribute  (description)>
  <!ATTLIST attribute  type CDATA  #REQUIRED
            default CDATA #IMPLIED
            required (yes | no) #IMPLIED>
  <!ELEMENT element  (description)>
  <!ATTLIST element  type CDATA  #REQUIRED
            minOccurs (0 | 1) #IMPLIED
            maxOccurs  (1 | *) #IMPLIED>
  <!ELEMENT description () #PCDATA>
  <!ELEMENT datatype ()>
  <!ATTLIST datatype
            dt:type %dataTypes; #REQUIRED>
  <!ELEMENT group(element, description)>
  <!ATTLIST group
            order (one | seq | many) #REQUIRED
            minOccurs (0 | 1)  1
            maxOccurs  (1 | *)  1>

Let's look at each of the elements contained in BizTalk schemas and see how they are used.