Fairlight CSV to XML Converter


Documentation
v01.00.01
Released: 01/02/08

Documentation

Program Summary

Using the Fairlight CSV to XML Converter, you can generate XML data from a simple two-field-per-line CSV format, including on-the-fly Base64 file encoding and encapsulation. This is an excellent companion for programs that don't inherently support XML exporting.

This command-line based program may be used directly, or used in automated systems. It is possible to build a GUI or web-based wrapper around the program (see the demo page below for a live example of such a creature).

Supported Platforms

Currently supported platforms are:

  • Windows 9x/NT/ME/2000/XP/2003
  • Any other platform that supports Perl and the required modules listed below.

    Required Modules

    The program requires the following modules be installed for Perl on any non-Windows platform:

    The self-extracting executable version for Windows meets all of these requirements for you. That version does not require perl be installed at all.

    Demo Versions

    This program can be tested via a web front-end designed specifically for this purpose.

    Click here to demo!

    Installation

    Windows

    Run the Win32 installer.

    Other Platforms

    Unpack the compressed tar or zip archive into any directory you choose. A subdirectory named csv2xml-install will be created, and all program and documentation files are present within this subdirectory. You may relocate the program from this directory to elsewhere.

    Edit the first line of the program file to reflect the location of your perl binary!

    Usage

    csv2xml [options] csv_filename

    Options

    CSV Format

    The format for the CSV this file uses is very specific. Please adhere to the rules that follow.

    Anywhere a non-value element (a "container" element that has no child elements should begin, the following line should be output:

    "__FLT_TAG_OPEN__","fieldname"

    Anywhere a non-value element (see above) should close, the following line should be output:

    "__FLT_TAG_CLOSE__","fieldname"

    Anywhere attributes start for an element, the following line should be output immediately after either 1) the __FLT_TAG_OPEN__ line that opened the non-value element, or 2) immediately after the line that gives a value-containing element in the case of a plain data element(the last line type depicted below):

    "__FLT_ATT_OPEN__","fieldname"

    Anywhere attributes end for an element, the following line should be output:

    "__FLT_ATT_CLOSE__","fieldname"

    All other lines representing elements with a value should be in the format:

    "name","value"

    The following is an example of a CSV that would generate valid output:

    Note how the attributes for container fields follow tag open lines, and the attributes for the plain data element (newfile) both follow their respective lines.

    You can copy the text from the textarea above, save it to a local file, and upload it into the demonstration to see the resultant XML, if you wish.

    Auto-Embedding/Encoding Files with Base64

    If you prefix an element's value with B64: in the form of:

    "Image_Data","B64:/path/to/file"

    ...then the whole contents of the indicated file will automatically be encoded in Base64 and placed in the field.

    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 csv2xml command. If the file is larger than zero bytes, check the file for the exact error.

    Changelog

    Copyright, License, Warranty, and Payment

    This software remains the property of Fairlight Consulting, and license to use the program is sold to users. Fairlight CSV to XML Converter is licensed at a cost of $495.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-release versions. Major version upgrades will be paid upgrades. Fairlight Consulting reserves the right to change this policy in the future, with no prior warning.

    There is no warranty for this software. This software is offered "AS-IS" and without warranties as to performance or merchantability or any other warranties, whether expressed or implied.

    Good computing practice dictates that any program should be thoroughly tested with non-critical data before deploying it for production. The user assumes the entire risk of using the program. In no event shall Fairlight Consulting be held liable for loss of data, failure of performance, or any other damages, be they real or perceived.

    If you agree to these terms, click here to order Fairlight CSV to XML Converter!


  • Copyright 2007, Fairlight Consulting. All rights reserved.

    Back to Fairlight Consulting