Don Mahoney - 2012-07-19

Why Text2XML?

Text2XML was created to facilitate the conversion of plain text files into structured XML documents. In this case, however, the data would arrive in different formats, yet all the data had to be converted to the same XML format.

Further complicating matters was the fact that the data formats do change over time. By maintaining all of the data mappings within XML, business analysts could quickly update the XML files, without the need to recompile programs.

How Does Text2XML work?

Text2XML consists of two main JAVA classes:

  • Text2XML processes a text file using a XML configuration file that describes the structure of the XML output, as well as mappings to the raw text file.

  • Text2XMLController is a wrapper for Text2XML which dynamically determines the appropriate XML configuration file to apply, based on business rules contained in the Text2XMLController configuration file.

Internally, Text2XML reads the text file and converts it into an XML document with the following structure:

<text>
<line lineNumber="1">...</line>
<line lineNumber="2">...</line>
</text>

The XML configuration file thus use XPath 2.0 expressions to parse data from this intermediate XML document.

Text2XML can be invoked via command line, or it can be embedded within another Java application.

For more information about Configuring Text2XML and using data mappings, see [ConfiguringText2XML].

For more information on using Text2XMLController, see [ConfiguringText2XMLController]

 

Related

Wiki: ConfiguringText2XML
Wiki: ConfiguringText2XMLController


Last edit: Don Mahoney 2012-09-15