Try OpenEdge Now
skip to main content
Working with XML
Reading and Writing XML Data from Temp-Tables and ProDataSets : Using XML Schema : Representing data-relations in XML Schema
 

Representing data-relations in XML Schema

In a ProDataSet, you form an association between two member temp-tables by creating a DATA-RELATION between the parent and child temp-table. ABL-specific XML Schema attributes for data relations are present in the XML Schema whether the min-xmlschema option on the WRITE-XML( ) or WRITE-XMLSCHEMA( ) method is TRUE or FALSE.
The following ABL-specific XML Schema attributes are added to help fully describe data-relations:
*foreignKeyHidden — Indicates that child rows omit foreign key fields when the data-relation is defined as a nested relation.
*nested — Indicates that child rows are nested within parent rows in the XML document.
*notActive — Indicates a data relation that is not currently active. This attribute supports ProDataSets that have multiple data relations defined with the intent that certain data relations are active for certain contexts and not active for others.
*recursive — Indicates a recursive data-relation.
*reposition — Indicates a REPOSITION data-relation.
If the column or columns from the parent temp-table are also the components in a unique index, the data-relation is represented with the combination of XML Schema unique (unique index definition) and keyref definitions. Here is the syntax for keyref:
<xsd:keyref name="RelationName" refer="UniqueIndexName"
prodata:nested="BooleanValue">
<xsd:selector xpath="ChildTableName" />
<xsd:field xpath="FieldName" />
...
<xsd:field xpath="FieldName" />
</xsd:keyref>
If the column or columns from the parent temp-table are not components in a unique index, the data-relation is represented with the ABL-specific relation definition. Here is the syntax for relation:
<prodata:relation name="RelationName"
prodata:nested="BooleanValue"
prodata:reposition="BooleanValue"
prodata:parent="ParentTableName"
prodata:child="ChildTableName"
                  prodata:relationFields="RelationFields" />