Copyright (c) 2013 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.
This Quick Start contains information on getting started with DataDirect XML Converters. For information about:
This document contains the following sections:
The DataDirect XML Converters jar file, XMLConverters.jar, must be included in your CLASSPATH. The CLASSPATH is the search string your Java Virtual Machine (JVM) uses to locate DataDirect XML Converters on your computer. If the DataDirect XML Converters jar file is not included in your CLASSPATH, you receive a ClassNotFoundException exception when trying to use DataDirect XML Converters.
Windows Example
set CLASSPATH=.;c:\ddxmlconverters\lib\XMLConverters.jar
UNIX/Linux Example
CLASSPATH=.:/home/user1/ddxmlconverters/lib/XMLConverters.jar
This simple application converts an EDI file of the X12 dialect (myEdi.x12) to an XML file with the name myEdi.x12.xml.
import com.ddtek.xmlconverter.*;
import javax.xml.transform.stream.*;
public class ConverterOne {
public static void main(String[] args) throws Throwable {
System.out.println(args[0] + " --> " + args[1]);
Converter toXML = new ConverterFactory().newConvertToXML("converter:EDI");
toXML.convert(new StreamSource(args[0]), new StreamResult(args[1]));
}
}
To invoke this program, type the following:
javac ConverterOne.java
java ConverterOne myEdi.x12 myEdi.x12.xml
See demo.java
in the \examples directory for additional examples of DataDirect XML Converters applications.