Field Element Nodes vs. Field Attribute Nodes
Overview
Flat file schemas are used by the flat file disassembler to control how inbound flat file instance messages are translated into their equivalent XML form, and are used by the flat file assembler to control how outbound XML messages are translated into their equivalent flat file instance messages. When constructing such schemas, you use either a Field Element node or a Field Attribute node in particular positions within the schema to control whether a particular field in the flat file instance message corresponds to an XML element or to an XML attribute in the equivalent XML form of the message.
Example
For example, the left-aligned, asterisk-padded field value "red*****
" in a flat file instance message can be translated into its equivalent XML representation in two different ways depending upon whether that field in the schema is a Field Element node or a Field Attribute node. When that field is represented in the schema by a Field Element node with its Node Name property set to "color", and the containing Record node has its Node Name property set to "shirt", the XML equivalent of the flat file field is (shown in bold type).
<shirt>
<color>red</color>
</shirt>
When that same flat file field is represented in the schema by a Field Attribute node with its Node Name property set to color, and the containing Record node has its Node Name property set to shirt, the XML equivalent of the flat file field is (shown in bold type):
<color shirt="red"/>
Note
Flat file schemas have a further restriction that within a given Record node, subordinate Field Attribute nodes must come before subordinate Record nodes or Field Element nodes.
See Also
- Field Considerations
- Node Name property in the UI guidance and developers API namespace reference