Diff for DITA 1.2 Specification - Building Specification Subsets

Sun, 2010-11-28 14:07 by StanDohertyTue, 2010-11-30 01:35 by StanDoherty
Changes to Body
Line 240Line 240
 
&lt;!-- &lt;property name=&quot;args.input&quot; value=&quot;non-normative-information.ditamap&quot;/&gt; --&gt;<br />
 
&lt;!-- &lt;property name=&quot;args.input&quot; value=&quot;non-normative-information.ditamap&quot;/&gt; --&gt;<br />
 
<p>
 
<p>
  +
<br />
 
To build different subsets of the specification, uncomment or re-comment the lines that call specific DITA maps. For example, in the above sample, the DITA map for the DITA Architectural Specification (architectural-specification.ditamap) is uncommented and will build when you run an ANT script with these lines.
 
To build different subsets of the specification, uncomment or re-comment the lines that call specific DITA maps. For example, in the above sample, the DITA map for the DITA Architectural Specification (architectural-specification.ditamap) is uncommented and will build when you run an ANT script with these lines.
 
</p>
 
</p>
Line 499Line 500
 
</p>
 
</p>
 
<p>
 
<p>
-
&nbsp;
+
====================================================== 
 
</p>
 
</p>
 
<p>
 
<p>
Revision of Tue, 2010-11-30 01:35:

DITA 1.2 Specification - Building Specification Subsets

Background

 

OASIS is releasing Version 1.2 of the OASIS Darwin Information Typing Architecture (DITA) specification developed by the OASIS DITA Technical Committee. Complete, OASIS-branded versions of the specification are available for you to download at the following site:

 

http://dita.xml.org/news/dita-12-submitted-for-oasis-ballot

In its complete form, this specification consists of the following separately buildable sections, each with its own DITA map:

  • Introduction (spec/introduction.ditamap)
  • Architectural Specification (architectural-specification.ditamap)
  • Language Reference Specification (language-reference.ditamap)
  • DITA Conformance Statement (conformance.dita)
  • Non-normative Information (non-normative-information.ditamap)

To build these specification subsets, you must install a build environment that is compliant with DITA Version 1.2 DTDs or schema. These DITA-compliant build environments are available as separate, downloadable packages or as components integrated with your DITA-compliant editor or content management system. For purposes of illustration, the build environment documented here consists of the following freely available and unmodified packages:

  • DITA Open Toolkit (DITA-OT1.5.2_m7)
    • EclipseHelp transformation
    • MS HTMLHelp (.chm) transformation
    • OpenOffice Document (.odt) transformation
    • PDF (Idiom) transformation
    • TOCJS transformation
    • XHTML transformation

Basic Build Procedure

To set up a basic build environment and to build subsets of the DITA 1.2 specification, do the following.

  1. Download and install the most current version of the DITA Open Toolkit.

    http://sourceforge.net/projects/dita-ot/
  2. For purposes of illustration, let's assume that you have installed the toolkit with its default folder name DITA-OT1.5.2.

    REMINDER: Execute the command 'ant -f integrator.xml' before attempting to build any DITA specification subsets.

  3. Download the DITA Version 1.2 specification source files from the following site.

    http://docs.oasis-open.org/dita/v1.2/cs01/spec/DITA1.2-spec.zip

  4. Unarchive these source files to a new folder at the root of the DITA Open Toolkit that you just installed.

    For purposes of illustration, let's assume that you unarchive the sources into a folder named DITA-OT1.5.2/dita1.2.

    Once unarchived, that folder would contain the following:

    /archSpec
    /common
    /introduction
    /langref
    /non-normative
    /resources
    architectural-specification.ditamap
    architectural_specification.dita
    archSpec-base.dita
    archSpec-learningTraining.dita
    archSpec-technicalContent.dita
    base_elements.ditamap
    conformance.dita
    dita-1.2-specification.ditamap
    DITA1.2-spec.zip
    ditaref-commonatts.ditamap
    ditaref-ditaval.ditamap
    element-quick-reference.dita
    introduction.ditamap
    langRef-base.dita
    langRef-learningTraining.dita
    langRef-technicalContent.dita
    language-reference.ditamap
    language_reference.dita
    learningTraining_elements.ditamap
    non-normative-information.ditamap
    r-acknowledgments.dita
    technicalContent_elements.ditamap
  5. Copy one or more of the ant build scripts documented below into this same DITA-OT1.5.2/dita1.2 folder.
  6. Edit (uncomment) these ant scripts to specify which DITA 1.2 Specification map you would like to build as a subset.

    • Introduction (introduction.ditamap)
    • Architectural Specification (architectural-specification.ditamap)
    • Language Reference Specification (language-reference.ditamap)
    • DITA Conformance Statement (conformance.dita)
    • Non-normative Information (non-normative-information.ditamap)
  7. Run the ant build script from the DITA-OT1.5.2/dita1.2 directory.

    For example, 'ant -f ant_dita1.2_subset_pdf2.xml'.

  8. Review build output in DITA-OT1.5.2/dita1.2/out/*.

Basic Build Results and Notes

The DITA Version 1.2 specification is a great resource for learning about new features in DITA 1.2 such as keyrefs, coderefs, map enhancements and many others.Here are the results of using the build tools documented here to build subsets of the DITA 1.2 Specification in multiple output formats.

Specification Subet Map/Topic EclipseHelp MS HTMLHelp Open Office PDF TOCJS XHTML
introduction.ditamap Successful Successful Successful Successful Successful Successful
architectural-specification.ditamap Successful Successful Successful Successful Successful Successful
language-reference.ditamap Successful Successful Not supported. [2] Not supported. [1] Successful Successful
conformance.dita Successful Successful Successful Successful Successful Successful
non-normative-information.ditamap Successful Successful Successful Successful Successful Successful


Notes and limitations

  • [1] The DITA 1.2 Specification Language Reference makes extensive use of keyrefs and conrefs. The default fo-to-PDF processor in the DITA Open Toolkit runs out of memory when attempting to build the Language Reference subset. If you have purchased a commercial processor such as XEP or Antenna House, you can build a PDF for Language Reference.

    When Java runs out of memory while building this subset, you will see the following error message.

    BUILD FAILED
    F:\DITA-OT1.5.2_m7\dita1.2\ant_dita1.2_subset_pdf2.xml:6: The following error oc
    curred while executing this line:
    F:\DITA-OT1.5.2_m6\build.xml:64: The following error occurred while executing th
    is line:
    F:\DITA-OT1.5.2_m6\build.xml:134: java.lang.OutOfMemoryError: Java heap space
  • [2] The DITA 1.2 Specification Language Reference makes extensive use of keyrefs and conrefs. The default ODT processor in the DITA Open Toolkit runs out of memory when attempting to build the Language Reference subset.

    When Java runs out of memory while building this subset, you will see the following error message.

    BUILD FAILED
    F:\DITA-OT1.5.2_m7\dita1.2\ant_dita1.2_subset_pdf2.xml:6: The following error oc
    curred while executing this line:
    F:\DITA-OT1.5.2_m6\build.xml:64: The following error occurred while executing th
    is line:
    F:\DITA-OT1.5.2_m6\build.xml:134: java.lang.OutOfMemoryError: Java heap space

DITA-OT Transformations and ANT Build Scripts

This section documents ANT build scripts that you an copy/paste into your DITA-OT1.5.2/dita1.2 folder in order to build DITA 1.2 Specification subsets for the following standard DITA-OT transformations:

  • EclipseHelp
  • MS HTMLHelp
  • Open Office Document (ODT)
  • PDF
  • TOCJS
  • XHTML

Specifying a DITA 1.2 Specification Map in ANT Scripts

Each of the following ANT scripts contains the following lines (or a minor variation of them):

<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->


To build different subsets of the specification, uncomment or re-comment the lines that call specific DITA maps. For example, in the above sample, the DITA map for the DITA Architectural Specification (architectural-specification.ditamap) is uncommented and will build when you run an ANT script with these lines.

Building EclipseHelp

To build one or more DITA 1.2 Specification subsets for EclipseHelp, copy the following text into a file named ant_dita1.2_subset_eclipsehelp.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="sample_eclipsehelp" default="sample2eclipsehelp" basedir=".">
<property name="dita.dir" value="${basedir}${file.separator}..${file.separator}..${file.separator}DITA-OT1.5.2_m6"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="sample2eclipsehelp" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->
<property name="output.dir" value="out${file.separator}eclipsehelp"/>
<property name="transtype" value="eclipsehelp"/>
</ant>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_eclipsehelp.xml

Review build output in DITA-OT1.5.2/dita1.2/out/eclipsehelp.

Building Microsoft HTMLHelp

To build one or more DITA 1.2 Specification subsets for Microsoft HTMLHelp, copy the following text into a file named ant_dita1.2_subset_htmlhelp.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="dita1.2_subsets_htmlhelp" default="sample2htmlhelp" basedir=".">
<property name="dita.dir" value="${basedir}${file.separator}..${file.separator}..${file.separator}DITA-OT1.5.2_m6"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="sample2htmlhelp" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->
<property name="output.dir" value="out${file.separator}htmlhelp"/>
<property name="transtype" value="htmlhelp"/>
</ant>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_htmlhelp.xml


Review build output (*.chm) in DITA-OT1.5.2/dita1.2/out/htmlhelp.

Building Open Office

To build one or more DITA 1.2 Specification subsets for Open Office (ODT), copy the following text into a file named ant_dita1.2_subset_odt.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="sample_odt" default="sample2odt" basedir=".">
<property name="dita.dir" value="${basedir}${file.separator}..${file.separator}..${file.separator}DITA-OT1.5.2_m6"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="sample2odt" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->
<property name="output.dir" value="out${file.separator}odt"/>
<property name="transtype" value="odt"/>
<property name="outer.control" value="quiet"/>
</ant>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_odt.xml

Review build output in DITA-OT1.5.2/dita1.2/out/odt.

Building PDF

To build one or more DITA 1.2 Specification subsets for PDF, copy the following text into a file named ant_dita1.2_subset_pdf2.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="dita1.2_subsets_pdf" default="sample2pdf2" basedir=".">
<property name="dita.dir" value="${basedir}${file.separator}..${file.separator}..${file.separator}DITA-OT1.5.2_m6"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="sample2pdf2" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->
<property name="output.dir" value="out${file.separator}pdf2"/>
<property name="transtype" value="pdf2"/>
<property name="outer.control" value="quiet"/>
</ant>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_pdf2.xml

Review build output in DITA-OT1.5.2/dita1.2/out/pdf2.

Building TOCJS

To build one or more DITA 1.2 Specification subsets for TOCJS, copy the following text into a file named ant_dita1.2_subset_tocjs.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="docondoc" default="all">
<import file="..${file.separator}conductor.xml"/>
<property name="dita.extname" value=".xml"/>
<property name="content.frame" value="contentwin"/>
<target name="sample2html" depends="use-init">
<antcall target="dita2xhtml">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <param name="args.input" value="introduction.ditamap"/> -->
<param name="args.input" value="architectural-specification.ditamap"/>
<!-- <param name="args.input" value="language-reference.ditamap"/> -->
<!-- <param name="args.input" value="conformance.dita"/> -->
<!-- <param name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <param name="args.input" value="non-normative-information.ditamap"/> -->
<param name="output.dir" value="out${file.separator}tocjs"/>
<param name="args.css" value="..${file.separator}demo${file.separator}tocjs${file.separator}sample${file.separator}basefiles${file.separator}sample.css"/>
<param name="args.copycss" value="yes"/>
</antcall>
<copy overwrite="true" file="..${file.separator}demo${file.separator}tocjs${file.separator}sample${file.separator}basefiles${file.separator}frameset.html" tofile="out${file.separator}tocjs${file.separator}frameset.html"/>
</target>
<target name="sample2tocjs" description="Generate tocjs javascript file" depends="sample2html">
<antcall target="dita2tocjs">
<param name="transtype" value="tocjs"/>
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <param name="args.input" value="introduction.ditamap"/> -->
<param name="args.input" value="architectural-specification.ditamap"/>
<!-- <param name="args.input" value="language-reference.ditamap"/> -->
<!-- <param name="args.input" value="conformance.dita"/> -->
<!-- <param name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <param name="args.input" value="non-normative-information.ditamap"/> -->
<param name="output.file" value="out${file.separator}tocjs${file.separator}toctree.js"/>
</antcall>
<copy todir="out${file.separator}tocjs">
<fileset dir="${dita.dir}${file.separator}demo${file.separator}tocjs${file.separator}basefiles">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="sampleclean" description="clean tocjs sample output">
<delete dir="${dita.dir}${file.separator}demo${file.separator}tocjs${file.separator}out"/>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_tocjs.xml sample2tocjs

Review build output (frameset.html) in DITA-OT1.5.2/dita1.2/out/tocjs.

Building XHTML

To build one or more DITA 1.2 Specification subsets for XHTML, copy the following text into a file named ant_dita1.2_subset_xhtml.xml and save that file to the DITA-OT1.5.2/dita1.2 directory.

<?xml version="1.0" encoding="UTF-8" ?>
<project name="sample_xhtml" default="sample2xhtml" basedir=".">
<property name="dita.dir" value="${basedir}${file.separator}..${file.separator}..${file.separator}DITA-OT1.5.2_m6"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="sample2xhtml" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<!-- //////////////////////////////////////////////////// -->
<!-- INSTALL THIS ANT FILE AT THE ROOT OF THE SAME FOLDER -->
<!-- THAT CONTAINS THE DITA1.2 SOURCE FILES. -->
<!-- UNCOMMENT ONE OR MORE OF THE FOLLOWING DITA MAPS -->
<!-- TO BUILD IT AS A SUBSET OF THE DITA 1.2 SPECIFICATION. -->
<!-- <property name="args.input" value="introduction.ditamap"/> -->
<property name="args.input" value="architectural-specification.ditamap"/>
<!-- <property name="args.input" value="language-reference.ditamap"/> -->
<!-- <property name="args.input" value="conformance.dita"/> -->
<!-- <property name="args.input" value="r-acknowledgments.dita"/> -->
<!-- <property name="args.input" value="non-normative-information.ditamap"/> -->
<property name="output.dir" value="out${file.separator}xhtml"/>
<property name="transtype" value="xhtml"/>
<property name="outer.control" value="quiet"/>
</ant>
</target>
</project>

CD to the DITA-OT1.5.2/dita1.2 subdirectory and run the following command.

$ ant -f ant_dita1.2_subset_xhtml.xml

Review build output (index.html) in DITA-OT1.5.2/dita1.2/out/xhtml.

====================================================== 

If you encounter difficulty building DITA 1.2 subsets using these tools, please feel free to get in touch with me.

Stan Doherty

OASIS DITA Technical Committee

stan@modularwriting.com

SDoherty@Bentley.edu 

XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I