XML schema with parent table fields interspersed among child tables
- Last Updated: February 17, 2025
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
XML schema with parent table fields interspersed among child tables
The following example demonstrates the functionality provided to create a DATASET definition from an XML schema where the parent fields of a temp-table are defined both before and after the nested child temp-tables:
|
In the above schema:
- The root element,
Buy, maps to a temp-table with four fields:TrxnTyp,TaxCode,ClientComm, andComments -
Buyhas two nested child temp-table definitions:Amt, with two fields:AmtTypeandAmtValuePayment, with two fields:PayTypeandCurrency
- The
TrxnTypfield from theBuytemp-table is defined before the nestedAmttemp-table definition. - The
TaxCodeandClientCommfields from theBuytemp-table are defined after the nestedAmttemp-table. - The
Commentsfield from theBuytemp-table is defined after the nestedPaymenttemp-table definition.
The following is the static ProDataSet definition for the XML schema:
|
READ-XML() or READ-XMLSCHEMA() creates
the dynamic equivalent of this static definition.
Since the Relation1 PARENT-ID-RELATION contains
a PARENT-FIELDS-BEFORE and PARENT-FIELDS-AFTER phrase,
the TrxnTyp fields of a Buy temp-table record
is written to XML before any Amt child records, and TaxCode and ClientComm fields
are written to XML after all Amt child records.
Since the Relation2 PARENT-ID-RELATION contains
a PARENT-FIELDS-AFTER phrase, the Comments field
of a Buy temp-table record is written to XML after
all Payment child records.