1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!-- (c) Copyright IBM Corp. 2005, 2006 All Rights Reserved. -->
|
---|
6 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
|
---|
7 | <reference id="h2d-java" xml:lang="en-us">
|
---|
8 | <title>Migrating HTML to DITA with Java command</title>
|
---|
9 | <refbody>
|
---|
10 | <section>
|
---|
11 | <title>Running example</title>
|
---|
12 | <ol>
|
---|
13 | <li>Start the command window.</li>
|
---|
14 | <li>Navigate to the directory of the migration tool.</li>
|
---|
15 | <li>(Optional) If the input HTML file contains namespace,
|
---|
16 | you can remove it by hand, or running the command below:
|
---|
17 | <p>enter the following command when using Saxon:
|
---|
18 | <codeblock>java com.icl.saxon.StyleSheet mytask.htm preprocess.xsl > mytask.htm</codeblock>
|
---|
19 | </p>
|
---|
20 | <p>enter the following command when using Xalan:
|
---|
21 | <codeblock>java org.apache.xalan.xslt.Process -in mytask.htm -xsl preprocess.xsl -out mytask.htm</codeblock>
|
---|
22 | </p>
|
---|
23 | </li>
|
---|
24 | <li>Use Saxon or Xalan directory to run the migration, on the command line,
|
---|
25 | <p>enter the following command when using Saxon:
|
---|
26 | <codeblock>java com.icl.saxon.StyleSheet mytask.htm h2d.xsl infotype=task > mytask.dita</codeblock>
|
---|
27 | </p>
|
---|
28 | <p>enter the following command when using Xalan:
|
---|
29 | <codeblock>java org.apache.xalan.xslt.Process -in mytask.htm -xsl h2d.xsl -out mytask.dita -param infortype task</codeblock>
|
---|
30 | </p>
|
---|
31 | </li>
|
---|
32 | </ol>
|
---|
33 | <p>You can also add other parameters to this properties file. See
|
---|
34 | the following table for details.</p>
|
---|
35 | <p><note>The output directory of the generated DITA file should exist, since
|
---|
36 | the XSLT processor can't create it automatically.</note></p>
|
---|
37 | </section>
|
---|
38 | <section>
|
---|
39 | <title>Supported parameters</title>
|
---|
40 | <p>The following table lists the supported parameters that you can set with the java command.</p>
|
---|
41 | <table>
|
---|
42 | <title>Table of supported parameters</title>
|
---|
43 | <tgroup cols="3">
|
---|
44 | <colspec colname="col1"/>
|
---|
45 | <colspec colname="col2"/>
|
---|
46 | <colspec colname="col3"/>
|
---|
47 | <thead>
|
---|
48 | <row valign="bottom">
|
---|
49 | <entry colname="col1">Parameter</entry>
|
---|
50 | <entry colname="col2">Description</entry>
|
---|
51 | <entry colname="col3">Required</entry>
|
---|
52 | </row>
|
---|
53 | </thead>
|
---|
54 | <tbody>
|
---|
55 | <row>
|
---|
56 | <entry colname="col1">infotype</entry>
|
---|
57 | <entry colname="col2">The infotype of generated
|
---|
58 | DITA files. Topic, concept, task, and reference
|
---|
59 | are valid values. Default is topic.</entry>
|
---|
60 | <entry colname="col3">No.</entry>
|
---|
61 | </row>
|
---|
62 | <row>
|
---|
63 | <entry colname="col1">dita-extension</entry>
|
---|
64 | <entry colname="col2">The extension for links that
|
---|
65 | go to other DITA topics. ".dita" and ".xml" are
|
---|
66 | valid values. Default is ".dita".
|
---|
67 | <note>The extension of the generated DITA file
|
---|
68 | can't specified by this parameter, it only
|
---|
69 | can be specified along with the output
|
---|
70 | filename.</note>
|
---|
71 | </entry>
|
---|
72 | <entry colname="col3">No.</entry>
|
---|
73 | </row>
|
---|
74 | <row>
|
---|
75 | <entry colname="col1">FILENAME</entry>
|
---|
76 | <entry colname="col2">It is used to determine
|
---|
77 | the main topic's ID. <note>The FILENAME should
|
---|
78 | ends with '.htm' or '.html'. Invalid ID
|
---|
79 | characters, including all numbers, will be
|
---|
80 | replaced with letters.</note></entry>
|
---|
81 | <entry colname="col3">No.</entry>
|
---|
82 | </row>
|
---|
83 | <row>
|
---|
84 | <entry colname="col1">default-lang</entry>
|
---|
85 | <entry colname="col2">The default language of
|
---|
86 | output DITA files. Default is "en-us".
|
---|
87 | <note>For supported language, please refer to
|
---|
88 | <codeph>strings.xml</codeph> under the
|
---|
89 | directory
|
---|
90 | <codeph>${ditaot_dir}/xsl/common</codeph>.
|
---|
91 | </note>
|
---|
92 | </entry>
|
---|
93 | <entry colname="col3">No.</entry>
|
---|
94 | </row>
|
---|
95 | </tbody>
|
---|
96 | </tgroup>
|
---|
97 | </table>
|
---|
98 | </section>
|
---|
99 | </refbody>
|
---|
100 | </reference>
|
---|