/* pi-tfx-parameterVarDefs.i */
/* Variables representing parameter values in the READ-XML( ), READ-XMLSCHEMA( ), WRITE-XML( ), and WRITE-XMLSCHEMA( ) methods. */ DEFINE VARIABLE cSourceType AS CHARACTER NO-UNDO. DEFINE VARIABLE cTargetType AS CHARACTER NO-UNDO. DEFINE VARIABLE cFile AS CHARACTER NO-UNDO. DEFINE VARIABLE cReadMode AS CHARACTER NO-UNDO. DEFINE VARIABLE cSchemaLocation AS CHARACTER NO-UNDO. DEFINE VARIABLE lOverrideDefaultMapping AS LOGICAL NO-UNDO. DEFINE VARIABLE cFieldTypeMapping AS CHARACTER NO-UNDO. DEFINE VARIABLE cVerifySchemaMode AS CHARACTER NO-UNDO. DEFINE VARIABLE cEncoding AS CHARACTER NO-UNDO. DEFINE VARIABLE lFormatted AS LOGICAL NO-UNDO. DEFINE VARIABLE lWriteSchema AS LOGICAL NO-UNDO. DEFINE VARIABLE lMinSchema AS LOGICAL NO-UNDO. DEFINE VARIABLE lWriteBeforeImage AS LOGICAL NO-UNDO. |
/* pi-tfx-read-1.p */
/* Provides XML Schema for a new dynamic temp-table. */ {pi-tfx-parameterVarDefs.i} DEFINE VARIABLE httCust AS HANDLE NO-UNDO. DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO. CREATE TEMP-TABLE httCust. ASSIGN cSourceType = "FILE" cFile = "ttCustomer.xsd" lOverrideDefaultMapping = ? cFieldTypeMapping = ? cVerifySchemaMode = ?. DISPLAY "Is dynamic temp-table PREPARED? " httCust:PREPARED SKIP. DISPLAY "Reading XML Schema..." SKIP. lReturn = httCust:READ-XMLSCHEMA(cSourceType, cFile, lOverrideDefaultMapping, cFieldTypeMapping, cVerifySchemaMode). IF lReturn THEN DO: DISPLAY "Is dynamic temp-table now PREPARED? " httCust:PREPARED SKIP. DISPLAY "How many columns in dynamic temp-table? " httCust:DEFAULT-BUFFER-HANDLE:NUM-FIELDS SKIP. END. |
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:element name="ttFeedback"> <xsd:complexType> <xsd:sequence> <xsd:element name="ttFeedbackRow" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:sequence> <xsd:element name="Contact" type="xsd:string"/> <xsd:element name="Company" type="xsd:string"/> <xsd:element name="EmailAddress" type="xsd:string"/> <xsd:element name="Phone" type="xsd:string"/> <xsd:element name="Fax" type="xsd:string"/> <xsd:element name="Comments" type="xsd:string"/> <xsd:element name="Department" type="xsd:string"/> <xsd:element name="Rating" type="xsd:integer"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> |
/* pi-tfx-read-1b.p */
/* Provides XML Schema for a new dynamic temp-table. */ {pi-tfx-parameterVarDefs.i} DEFINE VARIABLE httFeedback AS HANDLE NO-UNDO. DEFINE VARIABLE lReturn AS LOGICAL NO-UNDO. CREATE TEMP-TABLE httFeedback. ASSIGN cSourceType = "FILE" cFile = "ttFeedback.xsd" lOverrideDefaultMapping = ? cFieldTypeMapping = "Comments, CLOB" cVerifySchemaMode = ?. DISPLAY "Is dynamic temp-table PREPARED? " httFeedback:PREPARED SKIP. DISPLAY "Reading XML Schema..." SKIP. lReturn = httFeedback:READ-XMLSCHEMA(cSourceType, cFile, lOverrideDefaultMapping, cFieldTypeMapping, cVerifySchemaMode). IF lReturn THEN DO: DISPLAY "Is dynamic temp-table now PREPARED? " httFeedback:PREPARED SKIP. DISPLAY "What is the data type of the Comments field? " httFeedback:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("Comments"):DATA-TYPE. END. |