Highlighted
Absent Member.
Absent Member.
895 views

ONIX/XML to Excell

I need to write a program to read an ONIX(XML) file and create an Excel spreadsheet from the data. It seems there are a few ways to read xml files. What would be the best way/tool?

Thanks,

Steve

Tags (1)
0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: ONIX/XML to Excell

The answer really depends on what the XML data looks like. There are essentially two types of XML data - record-based and non-record based.

Every XML file has a single top-level element (the first non-comment line of the file).

A record-based XML file will have multiple second-level elements that look very similar. Take a look at sample/acuxml/customer.xml in your extend distribution. There are multiple <customer></ customer> elements, each of which has a similar format. This type of file is most easily processed using AcuXML as a line sequential or binary sequential file.

A non-record based XML file will have only a single second-level element, or multiple but with different names. Take a look at any XFD file generated by ACUCOBOL-GT (for example, compile iobench.cbl with the -Fx flag, and take a look at idx1.xfd). There are four sections, xfd:identification, xfd:keys, xfd:conditions, and xfd:fields. This type of structure would not map well to a sequential data file - you would need a different record type for each section. So the best technology for this would be C$XML.

I hope this helps.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.