Architecting and designing : XML integration with other methods : Data model to XML transformations : XML to data model transformations : Transforming XML elements
  
Transforming XML elements
If an XML element has no parent or has child symbols of type XML element or XML attribute it will be transformed to an Entity. The entity is given the name of the source XML element. If an entity exists in the target data model with this name, then the system creates a unique name by appending an underscore (_) followed by a number to the name.
Attributes are created according to these rules:
Each attribute created, creates a corresponding data element or data structure. Each attribute name is checked for duplication in the current entity. If an attribute name exists in the current entity the system creates a unique name for the attribute but the data element is shared.
Each child XML element symbol that is allowed to carry text (content is mixed or textOnly), becomes an attribute of the entity created. This attribute is given the same name as the entity.
Each child XML element symbol that does not have children itself also becomes an attribute of the created entity.
Each child XML attribute symbol becomes an attribute of the created entity.
Each child XML element entity or XML attribute entity symbol becomes an attribute, the new attribute is set to reference a new data structure. The data structure is built from the structure of the XML element entity or XML attribute entity as appropriate. Each child XML element or XML attribute becomes a referenced Data element of the data structure.
Example
An XML element with a child XML attribute:
becomes an entity with an attribute that uses a data element:
An XML element with a child XML attribute entity:
becomes an entity with an attribute that uses a data structure. The data structure contains two data elements, Attribute_1 and Attribute_2.
Attribute and data element property transformations
XML element to attribute
Symbol:
Type
Attribute
Name
Name of the source XML element.
Attribute Default Nullity
Set to False if minOccurs = 1, True if minOccurs = 0.
Attribute Unique
Set to False if maxOccurs = *, True if maxOccurs = 1.
Definition:
Type
Data element
Name
Name of the source XML element.
Data Type
Result of XML to entity relation data type mapping.
XML attribute to attribute
Symbol:
Type
Attribute
Name
Name of the source XML attribute.
Attribute Default Nullity
Set to False if Required = yes, True if Required = no.
Definition:
Type
Data element
Name
Name of the source XML attribute.
Data Type
Result of XML to entity relation data type mapping.
Default
Copies default property.
Note For XML attributes, the Required Override and the Default Override properties are checked for values before the Required and Default properties.
All text entity references are expanded and the fully expanded values are used in the property transformations described above. Text entities that contain DTD-specific values are recognized and transformed. For example, #REQUIRED is treated the same as the property “required” set to “yes”.
See also
XML to data model transformations