Field Element Nodes

Overview

In BizTalk Editor, you use Field Element nodes to describe items of information that are simple in nature, such as strings and numbers. Further, they are used when the information in question appears as the content of an XML element in an actual instance of a message, as opposed to appearing as the value of an attribute associated with an XML element. For additional information about information that is stored as attribute values, see Field Attribute Nodes.

Note

In BizTalk Editor, both the element and attribute elements can be represented by a Field node, although they have different icons associated with them in the schema tree view, a different XML representation in the XSD window, and different properties in the Visual Studio Properties window.

For any given item of information in an XML message, where item of information means a single discrete simple type, such as a string or number, there is always a question regarding whether that information should be represented as the attribute of an element, or as a subelement of that element. As a general rule, representing an item of information as an attribute tends to be more appropriate when the possible values are discrete, few in number, and tend to modify the semantics of the element itself. Representing an item of information as a subelement tends to be more appropriate when the possible values can repeat a variable number of times, are likely to have more widely ranging values, might be long, as in long strings, and are one of several sibling values where their order is relevant. If you are just creating a schema for an existing type of XML document, your choice of using a Field Element node or a Field Attribute node for a particular item of information has already been made for you, and you must use the node that matches the XML.

XSD representation

When a Field Element node is inserted into a Record node, it is inserted at the end of any other child nodes within the sequence element in the Record node. The following example shows a new Field Element node, in bold, inserted at the end of the sequence element in a Record node (with nodes named to clarify their identity).

<xs:element name="ContainingRecord">  
    <xs:complexType>  
        <xs:sequence>  
            <xs:element name="ExistingFieldElement" type="xs:string" />  
            <xs:element name="EmptyNestedRecord">  
                <xs:complexType />  
            </xs:element>  

        </xs:sequence>  
        <xs:attribute name="ExistingFieldAttribute" type="xs:string" />  
    </xs:complexType>  
</xs:element>  

See Also