

v01.01.07
Released: 09/27/08
Program Summary
Using the Fairlight XML to CSV Converter, you can generate straightforward CSV files that let you properly trace the flow of data in the original heirarchical structure, while eliminating the cumbersome parsing inherent in the design of XML. This tool is an ideal companion for applications that don't inherently understand XML, but which import CSV very easily.
This command-
Supported Platforms
Currently supported platforms are:
Required Modules
The program requires the following modules be installed for Perl on any non-
The self-
Demo Versions
This program can be tested via a web front-
Installation
Windows
Run the Win32 installer.
Other Platforms
Unpack the compressed tar or zip archive into any directory you choose. A subdirectory
named xml2csv-
Edit the first line of the program file to reflect the location of your perl binary!
Usage
xml2csv [options] xml_filename
Options
-
This option dictates an optional configuration file for the conversion.
-
This option denotes to what file the CSV output is written.
-
This option strips node paths from element name in the CSV file. Only the basename of the element will be provided if this option is used.
-
This option lets you change the comma separator to some other arbitrary character (or characters).
-
This option lets you change the double-
-
This specifies the path to which any decoded Base64 files will be saved.
-
This option is for internal xml2csv development, and/or bug report traces. This option should not normally be used unless you enjoy creating large files for no reason.
-
This option returns the program version information.
-
This option returns the program changelog information.
-
This option returns the program help (a briefer summary of the options) in a self-
Configuration Files
Optional configuration files may be used with XML files to handle two specific tasks
via the -
B64:node.path.to.encoded.element
If that syntax is used, the decoded file will be written to the working directory
(see the -
The second task is the exclusion of nodes or whole sections of nodes. The format of the rule is:
E:node.path.to.excluded.element
If this rule is used, the element indicated, all attributes, and all child elements will be excluded from the output. Please note that the syntax is identical for excluding an attribute of an element and an actual element. If you simply wish to exclude attribute size of element field_submission.form_field, you would specify E:field_submission.form_field.size as the rule.
All rules should be entered one rule per line. Blank lines and lines beginning with a pound sign (#) will be ignored. If you do not need to extract Base64 encoded data, nor exclude nodes, you do not need to use a configuration file.
Results
The results of XML to CSV conversion with this tool yield a CSV file made up of two fields per line, in the format:
"field1","field2"
Lines that are straight element or attribute values will generate lines where field
1 is the element or attribute name (including the node path, if -
"BatchEntries.BatchEntry.BatchCreatedBy","Mark Luljak"
Additionally, you will receive indicator lines that point to the status of progression through the data heirarchy. Any element that has no character data will generate the following type of line when that element opens. The line has a static first field indicating an element opened, and the second field will indicate which field was opened, like so:
"__FLT_TAG_OPEN__","fieldname"
Likewise, when the end of such an element (one with no character data) is encountered, the following line type will be generated. Again you will see a static first field, this time indicating that an element has closed, and the second field will show you which element closed, as illustrated below:
"__FLT_TAG_CLOSE__","fieldname"
Elements with or without character data can still have attributes. In all cases,
attributes are displayed with lines identical to the format used for data-
Indicator lines for open and close of element are meant to help you track your progress through the data relations in the XML.
Error Detection
All errors will be written to standard output. This means that if the program prints anything to what would be the terminal (or the console window in Windows), there was an error. Redirection of output to a file in any operating system will let you see if there was an error. The error will be contained in the file. If the program was 100% successful, there will be no output of this type, and any redirection destination file would be zero bytes long. If you use this method to catch errors in an automated system, check the file size after using a redirect with the xml2csv command. If the file is larger than zero bytes, check the file for the exact error.
Changelog
v01.01.00 -
Original Release.
v01.01.03 -
Fixed missing field open/close tags on self-
V01.01.04 -
Fixed blank line issue if all attributes for a tag were excluded in configuration file.
V01.01.07 -
Fixed SUID taint issues for filePro SYSTEM() functionality.
Copyright, License, Warranty, and Payment
This software remains the property of Fairlight Consulting, and license to use the program is sold to users. Fairlight XML to CSV Converter is licensed at a cost of $995.00 USD per server on which it is installed. Each license fee entitles you to use the program on one server, in any role you require.
Upon receipt of payment for a license, program will be delivered to the licensee via email at the email address associated with the PayPal payment.
Upgrades for the product are free when moving to new minor and bugfix point-
There is no warranty for this software. This software is offered "AS-
Good computing practice dictates that any program should be thoroughly tested with
non-