code-srv-test/dita-ot-3.6/doc/topics/project-files-xml.html
2021-03-23 22:38:58 +00:00

123 lines
No EOL
12 KiB
HTML

<!DOCTYPE html
SYSTEM "about:legacy-compat">
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2020"><meta name="generator" content="DITA-OT"><meta name="description" content="DITA-OT includes sample XML project files that can be used to define a publication project. The XML format can be validated with a RELAX&nbsp;NG schema provided in the resources folder of the DITA-OT installation (project.rnc)."><meta name="keywords" content="XML project files, project files, XML"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Sample XML project files</title></head><body id="ID"><header role="banner"><div class="header">
<p>DITA Open Toolkit</p>
<hr>
</div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.6</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../topics/installing-client.html">Installing DITA-OT</a></li><li><a href="../topics/building-output.html">Building output</a><ul><li><a href="../topics/build-using-dita-command.html">Using the dita command</a><ul><li><a href="../topics/using-dita-properties-file.html">Using a properties file</a></li><li><a href="../topics/migrating-ant-to-dita.html">Migrating Ant builds</a></li><li><a href="../topics/using-project-files.html">Using a project file</a><ul><li class="active"><a href="../topics/project-files-xml.html">XML project files</a></li><li><a href="../topics/project-files-json.html">JSON project files</a></li><li><a href="../topics/project-files-yaml.html">YAML project files</a></li></ul></li></ul></li><li><a href="../topics/using-docker-images.html">Using Docker images</a></li><li><a href="../topics/publishing-with-ant.html">Using Ant</a></li><li><a href="../reference/java-api.html">Using the Java API</a></li></ul></li><li><a href="../topics/input-formats.html">Authoring formats</a></li><li><a href="../topics/output-formats.html">Output formats</a></li><li><a href="../parameters/index.html">Parameters</a></li><li><a href="../topics/html-customization.html">Customizing HTML</a></li><li><a href="../topics/pdf-customization.html">Customizing PDF</a></li><li><a href="../topics/adding-plugins.html">Adding plug-ins</a></li><li><a href="../topics/custom-plugins.html">Creating plug-ins</a></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a></li><li><a href="../reference/index.html">Reference</a></li><li><a href="../topics/dita-and-dita-ot-resources.html">Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
<h1 class="title topictitle1" id="ariaid-title1">Sample XML project files</h1>
<div class="body conbody"><p class="shortdesc">DITA-OT includes sample XML project files that can be used to define a publication project. The XML format
can be validated with a RELAX&nbsp;NG schema provided in the <span class="ph filepath">resources</span> folder of the DITA-OT
installation (<span class="ph filepath">project.rnc</span>).</p>
<p class="p">Project files can be designed in a modular fashion to create reusable configuration structures that allow you to
define settings in one file and refer to them in other projects to publish multiple deliverables at once.</p>
<p class="p">For example, <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/html.xml</span> defines
a single HTML deliverable.</p>
<figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 1. </span>Sample project file for HTML output</figcaption>
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?xml-model href="https://www.dita-ot.org/rng/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;include href="common.xml"/&gt;
&lt;deliverable name="HTML5" id="html"&gt;
&lt;context idref="html"/&gt;
&lt;output href="."/&gt;
&lt;publication transtype="html5"&gt;
&lt;param name="args.copycss" value="yes"/&gt;
&lt;param name="args.css" value="dita-ot-doc.css"/&gt;
&lt;param name="args.csspath" value="css"/&gt;
&lt;param name="args.cssroot" path="../../resources"/&gt;
&lt;param name="args.gen.task.lbl" value="YES"/&gt;
&lt;param name="args.hdr" href="../../resources/header.xml"/&gt;
&lt;param name="html5.toc.generate" value="no"/&gt;
&lt;param name="nav-toc" value="partial"/&gt;
&lt;param name="processing-mode" value="strict"/&gt;
&lt;/publication&gt;
&lt;/deliverable&gt;
&lt;/project&gt;</code></pre>
</figure>
<p class="p">This file can be used to generate the HTML version of the DITA-OT documentation by running the following command
from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
<pre class="pre codeblock"><code><span class="keyword cmdname">dita</span> <span class="keyword parmname">--project</span>=<var class="keyword varname">samples/project-files/html.xml</var></code></pre>
<p class="p">The project file for HTML output imports the common <code class="ph codeph">html</code> context from a shared project context
defined in the <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/common.xml</span> file,
which includes the input map file and the DITAVAL file used to filter the output.</p>
<figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 2. </span>Sample shared context for HTML-based output</figcaption>
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?xml-model href="https://www.dita-ot.org/rng/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;context id="html" name="HTML"&gt;
&lt;input href="../../userguide.ditamap"/&gt;
&lt;profile&gt;
&lt;ditaval href="../../resources/html.ditaval"/&gt;
&lt;/profile&gt;
&lt;/context&gt;
&lt;/project&gt;</code></pre>
</figure>
<p class="p">The same common <code class="ph codeph">html</code> context is also referenced in the project file for HTMLHelp output, as
illustrated in <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/htmlhelp.xml</span>.</p>
<figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 3. </span>Sample project file for HTMLHelp output</figcaption>
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?xml-model href="https://www.dita-ot.org/rng/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;deliverable name="HTMLHelp" id="htmlhelp"&gt;
&lt;context idref="html"/&gt;
&lt;output href="htmlhelp"/&gt;
&lt;publication transtype="htmlhelp"&gt;
&lt;param name="args.copycss" value="yes"/&gt;
&lt;param name="args.css" value="dita-ot-doc.css"/&gt;
&lt;param name="args.csspath" value="css"/&gt;
&lt;param name="args.cssroot" path="../../resources"/&gt;
&lt;param name="args.gen.task.lbl" value="YES"/&gt;
&lt;param name="processing-mode" value="strict"/&gt;
&lt;/publication&gt;
&lt;/deliverable&gt;
&lt;/project&gt;</code></pre>
</figure>
<p class="p">The <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/pdf.xml</span> file defines a
single PDF deliverable.</p>
<figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 4. </span>Sample project file for PDF output</figcaption>
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?xml-model href="https://www.dita-ot.org/rng/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;deliverable id="pdf"&gt;
&lt;context name="User Guide"&gt;
&lt;input href="../../userguide-book.ditamap"/&gt;
&lt;/context&gt;
&lt;output href="."/&gt;
&lt;publication transtype="pdf2"&gt;
&lt;param name="args.chapter.layout" value="BASIC"/&gt;
&lt;param name="args.gen.task.lbl" value="YES"/&gt;
&lt;param name="include.rellinks" value="friend"/&gt;
&lt;param name="outputFile.base" value="userguide"/&gt;
&lt;param name="processing-mode" value="strict"/&gt;
&lt;/publication&gt;
&lt;/deliverable&gt;
&lt;/project&gt;</code></pre>
</figure>
<p class="p">This file can be used to generate the PDF version of the DITA-OT documentation by running the following command
from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
<pre class="pre codeblock"><code><span class="keyword cmdname">dita</span> <span class="keyword parmname">--project</span>=<var class="keyword varname">samples/project-files/pdf.xml</var></code></pre>
<p class="p">The <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/distribution-docs.xml</span> file
includes both the HTML and PDF projects as follows:</p>
<pre class="pre codeblock language-xml normalize-space show-whitespace"><code>&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;include href="html.xml"/&gt;
&lt;include href="pdf.xml"/&gt;
&lt;/project&gt;</code></pre>
<p class="p">To build both the HTML and PDF versions of the documentation as included in the distribution package, run the
following command from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
<pre class="pre codeblock"><code><span class="keyword cmdname">dita</span> <span class="keyword parmname">--project</span>=<var class="keyword varname">samples/project-files/distribution-docs.xml</var></code></pre>
<p class="p">The <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span><span class="ph filepath">/project-files/all.xml</span> file includes all
three project deliverables as follows:</p>
<pre class="pre codeblock language-xml normalize-space show-whitespace"><code>&lt;project xmlns="https://www.dita-ot.org/project"&gt;
&lt;include href="html.xml"/&gt;
&lt;include href="htmlhelp.xml"/&gt;
&lt;include href="pdf.xml"/&gt;
&lt;/project&gt;</code></pre>
</div>
<nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/using-project-files.html" title="DITA-OT 3.4 introduces new project files to define publication projects with multiple deliverables. Projects specify a context, output folder, and publication for each deliverable. A re-usable context groups source files and filters, and a publication defines an output format with transformation parameters. You can pass a project file to the dita command to publish multiple deliverables at once.">Publishing with project files</a></div></div></nav></article></main></body></html>