XmlConvFileToFile
This program converts an input file to an output file using Java API calls in XML Export, and a template file. See Explore Conversion Options with the Sample Programs for more information on templates.
It demonstrates the following functions:
-
Extracts file format information (document type, format, and version) if it is available in the source document.
-
Extracts metadata if it is available in the source document.
NOTE: Although the program extracts all the metadata in the document, it only displays the first element of metadata.
-
Displays a list of the files that are automatically generated during the conversion.
-
Specifies the directory in which temporary files created during conversion processes are stored. To specify the temporary directory, remove the comment from the following line in the
XmlConvFileToFile.javafile:objXmlExport.setConfigOption(new ConfigOption(Export.CFG_SETTEMPDIRECTORY, 0, "C:\\tmp"));
NOTE: On Windows systems, there is a 64 K size limit to the temporary directory. After the limit is reached, you must either create a new directory or delete the contents of the existing directory; otherwise, you might receive an error message.
-
Extracts elements from a source XML file based on the extraction settings in the
kvxconfig.inifile. See Configure Element Extraction for XML Documents.
Run XmlConvFileToFile on Windows
To run XmlConvFileToFile on Windows
-
In the
XmlConvFileToFile.batfile, setINSTALL_DIRto the Export SDK installation directory. -
In the first line of the
XmlSampleConfig_nt.txtfile, specify the path to the template file used in the conversion. You can use any of the template files in theinstall\xmlexport\programs\inidirectory, whereinstallis the path name of the Export installation directory. If you are processing XML files, specify the location of thekvxconfig.inifile. This is in thebindirectory. -
In the second line of the
XmlSampleConfig_nt.txtfile, specify the path to theExport SDK\bindirectory. -
Run the batch file in the
install\javaapi\sampledirectory. Type the following:XmlConvFileToFileinputfileoutputfilewhere:
inputfileis the path and file name of the source file.outputfileis the path and file name of the generated XML file. If you do not specify a path, the XML file is output to the current directory.To view the XML file in a browser, the
Verity.dtdand other support files (.xsland.ent) must be in the same directory as the XML file. These files are in theinstall\javaapi\sampledirectory.
Run XmlConvFileToFile on UNIX
To run XmlConvFileToFile on UNIX
-
In the
XmlConvFileToFile.cshfile, setMKENVto the platform on which you are running, either_hpux11,_ilnx21,_rs6k43, or_ssol26. -
In the
XmlConvFileToFile.cshfile, setINSTALL_DIRto the Export SDK installation directory. -
In the first line of the
XmlSampleConfig_unix.txtfile, specify the path to the template file used in the conversion. You can use any of the template files in theinstall/xmlexport/programs/inidirectory, whereinstallis the path name of the Export installation directory. If you are processing XML files, specify the location of thekvxconfig.ini file. This is in thebindirectory. -
In the second line of the
XmlSampleConfig_unix.txtfile, specify the path to the directoryExport SDK/bin.NOTE: If you have copied the
XmlSampleConfig_unix.txtand C shell file from a Windows system or edited the files on a Windows system, remove the carriage returns from these files. You can use a utility such as the ColdFusion functionstripcr()(http://www.macromedia.com) to do this. This step is not required if the files are taken from the UNIX installation. -
Run the C shell file in the
install/javaapi/sampledirectory. Type the following:./XmlConvFileToFile.cshinputfileoutputfilewhere,
inputfileis the path and file name of the source file.outputfileis the path and file name of the generated XML file. If a path is not specified, the XML file is output to the current directory.