Scenario: dtxany2xml usage

The following example shows how you can use the dtxany2xml utility command:

This exercise uses sample files that are shipped with the product.

To create a map that can transform any input data into XML output:

  1. From a command prompt, change your directory location:

    cd c:/Program Files/IBM/WebSphere Transformation Extender 8.1/ examples/general/states

  2. Enter the following command:

    dtxany2xml states.mtt Data:Input:UnitedStates sts.txt xml_output.xml XML_map XML_log.log

    This command produces the following results:
    • A new XML Schema – named using the schema name plus the selected type name (states_UnitedStates.xsd).
    • A new map source file (XML_map.mms) that contains two maps:
      • first map (XML_map)
        • The input card references the original schema (states.mtt) and input file (sts.txt).
        • The output card references the newly created XML schema (states_UnitedStates.mtt ).
        • The type is Doc XSD.
        • The output file is xml_output.xml.
      • second map (XML_map_r)
        • The input card references the newly created XML schema (states_UnitedStates.mtt) and file (xml_output.xml).
        • The output card references the original schema (states.mtt).
        • The type is Data Input UnitedStates.
        • The output file is sts.txt.

        Use the second map only when the schema that you specified in the first parameter of the dtxany2xml utility command was imported from a COBOL copybook.

    • The log file (XML_log.log) is created only when an error occurs.
  3. Using Map Designer, open install_dir\examples\general\states\ XML_map.mms.
  4. Build and run XML_map.
The input (sts.txt) is converted to XML output (xml_output.xml). The input (xml_output.xml), which was created by the first map, is converted back to text output (sts.txt).