/* pi-tfx-writeSetup-4.i */
/* Definition of a ProDataSet. */ . . . DEFINE DATASET DSET FOR ttDepartment, ttEmployee, ttFamily, ttBenefits DATA-RELATION DeptEmp FOR ttDepartment, ttEmployee RELATION-FIELDS(deptcode, deptcode) NESTED DATA-RELATION EmpFam FOR ttEmployee, ttFamily RELATION-FIELDS (empnum,empnum) NESTED DATA-RELATION EmpBene FOR ttEmployee,ttBenefits RELATION-FIELDS (empnum,empnum) NESTED. . . . |
/* pi-tfx-write-4.p */
/* Writes the data from a static ProDataSet to an XML file. */ {pi-tfx-parameterVarDefs.i} {pi-tfx-writeSetup-4.i} DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO. ASSIGN cTargetType = "FILE" cFile = "Dept400.xml" lFormatted = TRUE cEncoding = ? cSchemaLocation = ? lWriteSchema = FALSE lMinSchema = FALSE lWriteBeforeImage = FALSE. lReturn = DATASET DSET:WRITE-XML(cTargetType, cFile, lFormatted, cEncoding, cSchemaLocation, lMinSchema, lWriteBeforeImage). |
<?xml version="1.0"?>
<DSET xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ttDepartment><DeptCode>400</DeptCode> <DeptName>Sales</DeptName> <ttEmployee> <EmpNum>3</EmpNum> <LastName>Smith</LastName> <FirstName>Justine</FirstName> <Address>1342 Atlantic Ave</Address> <Address2>Apt 345b</Address2> <City>Boston</City> <State>MA</State> <PostalCode>01834</PostalCode> <HomePhone>617 333-3334</HomePhone> <WorkPhone>800 787-8484</WorkPhone> <DeptCode>400</DeptCode> <Position>Sales Manager</Position> <Birthdate>1960-01-08</Birthdate> <StartDate>1997-06-19</StartDate> <VacationDaysLeft>5</VacationDaysLeft> <SickDaysLeft>4</SickDaysLeft> <ttFamily> <EmpNum>3</EmpNum> <RelativeName>Kelly Smith</RelativeName> <Relation>Daughter</Relation> <Birthdate>1993-08-18</Birthdate> <CoveredOnBenefits>true</CoveredOnBenefits> <BenefitDate>1997-06-19</BenefitDate> </ttFamily> <ttFamily> <EmpNum>3</EmpNum> <RelativeName>Mark Smith</RelativeName> <Relation>Spouse</Relation> <Birthdate>1960-01-08</Birthdate> <CoveredOnBenefits>true</CoveredOnBenefits> <BenefitDate>1998-02-21</BenefitDate> </ttFamily> |
<ttDepartment>
<ttEmployee> <EmpNum>3</EmpNum> ... </ttEmployee> <ttEmployee> <EmpNum>6</EmpNum> ... </ttEmployee> . . . <ttFamily> <EmpNum>3</EmpNum> ... </ttFamily> <ttFamily> <EmpNum>3</EmpNum> ... </ttFamily> <ttFamily> <EmpNum>3</EmpNum> .ttFamily.. </ttFam> <ttFamily> <EmpNum>6</EmpNum> ... </ttFamily> . . . </ttDepartment> |