How to export xml file in progress 4gl?

Nisanth Krishnan

I'm a rookie in progress 4gl. Can any one say how to export xml format like as follows using SAX-WRITER in Progress 4GL. Here is the format;

<?xml version="1.0" encoding="UTF-8"?>
    <IoTInfo>
        <Info Name="ApplicationID" Value="IoTBuffer" />
        <Info Name="ResourceID" Value="Lansing_DO" />
        <Info Name="HostName" Value="Adient-RTA-USE-IoTHub-01.azure-devices.net" />
        <Info Name="DeviceId" Value="582-01" />
        <Info Name="PrimaryDeviceKey" Value="4n3yEihan+ikfEe1EkI0i/CNeTfiMHdzQCcUQthO4R4=" />
        <Info Name="SecondaryDeviceKey" Value="Ue7dNJvVYGRmyVIl4l91hQS0TUDCwvdLs/2X+OWUBe0=" />
        <Info Name="TransportType" Value="Mqtt_WebSocket_Only" />
        <Info Name="RetryPolicy" Value="Exponential_Backoff_With_Jitter" />
        <Info Name="OperationTimeout" Value="15000" />
        <Info Name="IoTMessage" Value="{&quot;DeviceId&quot;:&quot;469&quot;}" />
        <Info Name="MsgTimeStamp" Value="11/20/2019 1:40:12 PM" />
    </IoTInfo>
Jensd

You don't need the SAX-WRITER for that. You can define a simple dataset and a temp-table and output it's XML representation.

DEFINE TEMP-TABLE ttInfo NO-UNDO SERIALIZE-NAME "info"
    FIELD InfoName  AS CHARACTER XML-NODE-TYPE "attribute" SERIALIZE-NAME "Name"   
    FIELD InfoValue AS CHARACTER XML-NODE-TYPE "attribute" SERIALIZE-NAME "Value" .

DEFINE DATASET dsInfo SERIALIZE-NAME "IoTInfo" FOR ttInfo .  

CREATE ttInfo.
ASSIGN ttInfo.InfoName  = "ApplicationID"
       ttInfo.InfoValue = "InfoValue".

CREATE ttInfo.
ASSIGN ttInfo.InfoName  = "ResourceID"
       ttInfo.InfoValue = "Lansing_DO".

DATASET dsInfo:WRITE-XML("file", "c:\temp\xml.xml", FALSE).

DISPLAY "Done".    

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to read a XML file and export an item using Progress 4GL

Progress Database 4GL - Math calculate for export file

How to match a records in progress 4GL?

How fast can a file be written/read by progress 4GL program?

Progress 4GL: How to generate different log file name when multiple processes using the same Timestamp?

How to assign content of a file to a string variable in progress openedge 4gl?

How to run .exe/.bat file with INPUT/OUTPUT in Progress 4GL

How do I get the latest file from a directory in Progress 4gl?

Where srt file will be exported in Windows OS? - PROGRESS 4GL

How do I count total lines and create new/Select sheet in one csv file using progress 4GL?

How to list all lines in a field with Progress 4GL

How to hide form fields data? - PROGRESS 4GL?

How to store the data in database in chinese language on progress 4gl?

How to converts a character to decimal on progress 4GL?

How to fix Dynamic Query error for progress 4gl?

How to rethrow caught exception in progress 4gl?

Progress 4GL: How to find where a procedure is defined

How to test if string is numeric using Progress 4GL

How to send a SOAP headers in Progress 4GL

How can i get the same result in Progress 4gl?

How to make a multidimensional array in Progress 4GL?

progress 4gl query for export count of records in all table available in db

Datatype in progress 4gl

How to check XML file if node exists and retrieve value in Progress4GL

Getting XML data into Temp-Table in Progress 4GL/OpenEdge ABL

How to get the last comma separated data stored in a variable? - Progress 4gl

how to apply last key from a program itself without requiring a user input? - PROGRESS 4GL

How add only required fields from table to dynamic temp table? - PROGRESS 4GL

How do I call the procedure section from window application using asynchronous method on progress 4GL?