Editar

Compartilhar via


Any Attribute Nodes

In BizTalk Editor, you can use an Any Attribute node to indicate a (known) element within an instance message for which zero or more unknown attributes may appear. This accommodates situations in which you know that a particular element will be present at a particular location within an instance message, but you are not sure exactly what attributes that element might include. If you place an Any Attribute node within the Record node associated with the relevant element, BizTalk can process that element, with the only requirement being that any associated attributes are syntactically correct (attributeName="attributeValue").

Note

In BizTalk Editor, the Any Attribute node is represented with the string <AnyAttribute> in the schema tree view.

Note

You can control the degree to which the unknown portion of the message is validated as well-formed XML by using the Process Contents property. In many cases you may need to set the Process Contents property to Skip for the contents of an instance message at the location of the Any Attribute node to be processed. Retaining the default value of Strict for the Process Contents property will prevent instance message validation from passing.

More details on this property in the UI guidance and developers API namespace reference.

XSD representation

When an Any Attribute node is added to a Record node or to an Attribute Group node, a single XML tag is added to the corresponding XML Schema definition (XSD) language representation of the schema. In the following example, a new Any Attribute node, whose XSD representation is shown in bold, has been added to an existing Record node that already contains a Field Element node.

<xs:element name="ExistingRecord">  
    <xs:complexType>  
        <xs:sequence>  
            <xs:element name="ExistingFieldElement" type="xs:string" />  
        </xs:sequence>  
        <xs:anyAttribute />  
    </xs:complexType>  
</xs:element  

In the preceding example, the XSD representation of the new Any Attribute node adds an anyAttribute element to the end of the containing (Record node) element element, outside the sequence element and within the complexType element. This is where all attribute elements, other than those with an Attribute Group node, are added to their containing element elements.

Now, and assuming that the Process Contents property of the Any Attribute node is set to Skip, within an instance message governed by this schema fragment, an ExistingRecord element is expected, and it can contain any attributes so long as they are well-formed with respect to XML syntax. (To conform to the XSD fragment in this example, it must also contain the ExistingFieldElement element as well.)

See Also

BizTalk Representation of Schemas
Node Properties
How to Set Node Properties
Any Element Nodes