XML

The description Element

A description element can be used in an AttributeType, an ElementType, a Schema, a group, an element, or an attribute element. The description element contains a description of the element. A typical description element might look like this:

  <description>This document is a purchase order for Northwind
     Traders.
  </description>

The datatype Element

The datatype element is used to specify the data type of an element or an attribute. The datatype element uses predefined data types. The current data types are listed in the following table.

Current Data Types

Data Type Description
bin.base64

A MIME-style base64-encoded binary large object (BLOB).

bin.hex

Hexadecimal digits representing octets.

boolean

0 or 1, where 0 = "false" and 1 = "true".

char

A string, one character long.

date

A date in a subset ISO 8601 format, without the time data-for example, "2000-11-05".

dateTime

A date in a subset ISO 8601 format, with an optional time and no optional zone-for example, "2000-07-07T18:39:09". Fractional seconds can be as precise as nanoseconds.

dateTime.tz

A date in a subset ISO 8601 format, with an optional time and an optional zone-for example, "2000-04-07T18:39:09-08:00". Fractional seconds can be as precise as nanoseconds.

fixed.14.4

The same as number, but no more than 14 digits to the left of the decimal point and no more than 4 digits to the right.

float

A real number that has no limit on the number of digits; it can have a leading sign, or fractional digits, or an exponent. Punctuation is in U.S. English. Values range from 1.7976931348623157E+308 through 2.2250738585072014E-308.

int

A number, with optional sign, no fractions, and no exponent.

number

A number that has no limit on digits; it can have a leading sign, fractional digits, or an exponent. Punctuation is in U.S. English. Values have same range as the most significant number, r8-that is, 1.7976931348623157E+308 through 2.2250738585072014E-308.

time

A time in a subset ISO 8601 format, with no date and no time zone-for example, "08:15:27".

time.tz

A time in a subset ISO 8601 format, with no date but an optional time zone-for example, "08:1527-05:00"

i1

An integer represented in one byte-that is, a number with an optional sign, no fractions, and no exponent-for example, "1, 127, -128".

i2

An integer represented in one word-that is, a number with an optional sign, no fractions, and no exponent-for example, "1, 703, -32768".

i4

An integer represented in four bytes-that is, a number with an optional sign, no fractions, and no exponent-for example, "1, 703, -32768, 148343,-1000000000".

r4

A real number, with no limit on digits. Can potentially have a leading sign,fractional digits, and optionally an exponent. Punctuation is in U.S. English. Values range from 3.40282347E+38F through 1.17549435E-38F.

r8

The same as float-that is, a real number that has no limit on the number of digits. Can have a leading sign, fractional digits, or an exponent. Punctuation is in U.S. English. Values range from 1.7976931348623157E+308 through 2.2250738585072014E-308.

ui1

An unsigned integer-that is, an unsigned number with no fractions and no exponent-for example, "1,255".

ui2 An unsigned integer represented in two bytes-that is, an unsigned number with no fractions and no exponent-for example, "1,255,65535".
ui4 An unsigned integer represented in four bytes-that is, an unsigned number-with no fractions and no exponent-for example, "1,703,3000000000".
uri A URI-for example, "urn:schemas-microsoft-com:Office9".
uuid Hexadecimal digits representing octets, optionally embedded with hyphens that are ignored-for example, "333C7BC4-460F-11D0-BC04-0080C7055A83".

The datatype element has one attribute: dt:type. The dt:type attribute can be set to one of the values in this table.

The datatype element can be used as shown here:

  <datatype dt:type=="char"/>

The AttributeType Element

Declaring attributes in BizTalk schemas is a two-step process. First, you must define the attribute using the AttributeType element. Second, you associate this attribute with an element using the attribute element. If the AttributeType element is declared as a child element of the Schema element, the AttributeType element will have document-level scope. If the AttributeType element is a child element of an ElementType element, it has local scope to that element. This scenario is similar to the W3C standard.

The AttributeType element can have two child elements: description and datatype. The datatype element can be used interchangeably with the dt:type attribute. For attributes, the Microsoft XML parser can use only the following data types: entity, entities, enumeration, id, idref, idrefs, nmtoken, nmtokens, notation, and string. You can use the dt:values attribute to list the possible values for an enumerated type when dt:type is set to enumeration.

The value of the default attribute is the default value for the attribute. If dt:type is set to enumeration, the value of the default attribute must be one of the values listed in dt:values.

The name attribute specifies the name of the AttributeType element; it will be used to reference the AttributeType element. The required attribute indicates whether the attribute is required.

An example of an AttributeType declaration is shown here:

  <AttributeType name="colors"
     dt:type="enumeration" dt:values="red green"/>
  <AttributeType name="pageCount" dt:type="int"/>