[Previous] [Contents] [Next]

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"/>


[Previous] [Contents] [Next]