<?xml version="1.0" encoding="UTF-8"?>
<CustomerOrders> <Customer> <CustNum>1</CustNum> <Name>LiftTours</Name> <Order> <OrderNum>100</OrderNum> <OrderTotal>1234.89</OrderTotal> </Order> <Order> <OrderNum>150</OrderNum> <OrderTotal>999.99</OrderTotal> </Order> </Customer> <Customer> <CustNum>3</CustNum> <Name>Hoops</Name> <Order> <OrderNum>200</OrderNum> <OrderTotal>1899.99</OrderTotal> </Order> </Customer> </CustomerOrders> |
DEFINE TEMP-TABLE Customer NO-UNDO
FIELD CustNum as INTEGER FIELD Name as CHARACTER. DEFINE TEMP-TABLE Order NO-UNDO FIELD OrderNum AS INTEGER FIELD OrderTotal AS DECIMAL FIELD Customer_id AS RECID XML-NODE-TYPE "HIDDEN". DEFINE DATASET CustomerOrders FOR Customer, Order PARENT-ID-RELATION Relation1 FOR Customer, Order PARENT-ID-FIELD Customer_id. |
CREATE Customer.
ASSIGN CustNum = 1 Name = "Lift Tours". CREATE Order. ASSIGN OrderNum = 100 OrderTotal = 1234.89 Customer_id = RECID(Customer). CREATE Order. ASSIGN OrderNum = 150 OrderTotal = 999.99 Customer_id = RECID(Customer). CREATE Customer. ASSIGN CustNum = 3 Name = "Hoops". CREATE Order. ASSIGN OrderNum = 200 OrderTotal = 1899.99 Customer_id = RECID(Customer). DATASET CustomerOrders:WRITE-XML("file", "CustomerOrders.xml", TRUE). |