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?
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.