Set Conversion Options
Conversion options are parameters that determine the content, structure, and appearance of the XML output. For example, you can specify:
- the markup inserted at the beginning and end of specific XML blocks
- whether a heading is included in the table of contents
- the output character set
- the resolution at which graphics are converted.
Set Conversion Options by Using the API
You set conversion options using the following methods on your instance of XmlExport
:
setOptionInfo
setTemplateInfo
setTOCOptionInfo
For more information about these methods and the options that you can set, refer to the Javadoc supplied with the XML Export SDK.
Alternatively, you can set conversion options by passing the path of an initialization file to the API using the setIniFileName
method on your instance of XmlExport
. For more information about initialization files, see Explore Conversion Options with the Sample Programs.
Explore Conversion Options with the Sample Programs
To make it easier to explore the conversion options, XML Export includes some sample configurations in the form of initialization (.ini
) files. These are read by the XmlTest sample program (you must supply the .ini
file path as a command-line argument). The sample program reads the configuration, and converts your input file into XML using the options you set, by passing them into the API. This lets you try out conversion options without programming.
You can use a text editor to customize the configuration files. In general, a section name refers to the structure containing an option, and a parameter name matches an element of that structure. For example:
[KVXMLOptions] eOutputCharSet=KVCS_SJIS bForceOutputCharSet=TRUE
This sets the eOutputCharSet
and bForceOutputCharSet
elements in the KVXMLOptions
structure.
NOTE: To create valid XML, an initialization file must define at least two structures: KVXMLTemplate
and KVXMLOptions
Templates
The template files for the Java API implementation are in the directory install\javaapi\ini\html
, where install
is the path name of the Export installation directory.
The following templates are provided for the Java implementation.