<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <element name="Air_FlightInfo"> <complexType> <sequence> <element name="generalFlightInfo"> <complexType> <sequence> <element name="flightDate" minOccurs="0"> <complexType> <sequence> <element name="departureDate" type="xsd:date"/> <element name="departureTime" type="xsd:string"/> <element name="arrivalDate" type="xsd:date"/> <element name="arrivalTime" type="xsd:string"/> </sequence> </complexType> </element> <element name="flightIdentification" minOccurs="0"> <complexType> <sequence> <element name="flightNumber" type="xsd:string"/> <element name="operationalSuffix" type="xsd:string"/> </sequence> </complexType> </element> </sequence> </complexType> </element> </sequence> </complexType> </element> </schema> |
DEFINE TEMP-TABLE generalFlightInfo NO-UNDO
FIELD generalFlightInfo_field AS INTEGER XML-NODE-TYPE "Hidden". DEFINE TEMP-TABLE flightDate NO-UNDO FIELD departureDate AS DATE FIELD departureTime AS CHARACTER FIELD arrivalDate AS DATE FIELD arrivalTime AS CHARACTER FIELD generalFlightInfo_id AS RECID XML-NODE-TYPE "Hidden". DEFINE TEMP-TABLE flightIdentification NO-UNDO FIELD flightNumber AS CHARACTER FIELD operationalSuffix AS CHARACTER FIELD generalFlightInfo_id AS RECID XML-NODE-TYPE "Hidden". DEFINE DATASET Air_FlightInfo FOR generalFlightInfo, flightDate, flightIdentification PARENT-ID-RELATION Relation1 FOR generalFlightInfo, flightDate PARENT-ID-FIELD generalFlightInfo_id PARENT-ID-RELATION Relation2 FOR generalFlightInfo, flightIdentification PARENT-ID-FIELD generalFlightInfo_id. |
CREATE generalFlightInfo.
CREATE flightDate. ASSIGN flightDate.departureDate = 12/2/2010 flightDate.departureTime = "13:15" flightDate.arrivalDate = 12/2/2010 flightDate.arrivalTime = "16:45" flightDate.generalFlightInfo_id = RECID(generalFlightInfo). CREATE flightIdentification. ASSIGN flightIdentification.flightNumber = "1024" flightIdentification.operationalSuffix = "ABC" flightIdentification.generalFlightInfo_id = RECID(generalFlightInfo). DATASET Air_FlightInfo:WRITE-XML("file", "FlightInfo.xml", TRUE). |
<?xml version="1.0" encoding="UTF-8"?>
<Air_FlightInfo> <generalFlightInfo> <flightDate> <departureDate>2010-12-02</departureDate> <departureTime>13:15</departureTime> <arrivalDate>2010-12-02</arrivalDate> <arrivalTime>16:45</arrivalTime> </flightDate> <flightIdentification> <flightNumber>1024</flightNumber> <operationalSuffix>ABC</operationalSuffix> </flightIdentification> </generalFlightInfo> </Air_FlightInfo> |