project-files-xml.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <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="DC.rights.owner" content="(C) Copyright 2020"><meta name="DC.type" content="concept"><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 NG schema provided in the resources folder of the DITA-OT installation (project.rnc)."><meta name="DC.subject" content="XML project files, project files, XML"><meta name="keywords" content="XML project files, project files, XML"><meta name="DC.relation" scheme="URI" content="../topics/using-project-files.html"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="ID"><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">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.5</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">
  7. <h1 class="title topictitle1" id="ariaid-title1">Sample XML project files</h1>
  8. <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
  9. can be validated with a RELAX NG schema provided in the <span class="ph filepath">resources</span> folder of the DITA-OT
  10. installation (<span class="ph filepath">project.rnc</span>).</p>
  11. <p class="p">Project files can be designed in a modular fashion to create reusable configuration structures that allow you to
  12. define settings in one file and refer to them in other projects to publish multiple deliverables at once.</p>
  13. <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
  14. a single HTML deliverable.</p>
  15. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 1. </span>Sample project file for HTML output</figcaption>
  16. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  17. &lt;?xml-model href="../../../resources/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
  18. &lt;project xmlns="https://www.dita-ot.org/project"&gt;
  19. &lt;include href="common.xml"/&gt;
  20. &lt;deliverable name="HTML5" id="html"&gt;
  21. &lt;context idref="html"/&gt;
  22. &lt;output href="."/&gt;
  23. &lt;publication transtype="html5"&gt;
  24. &lt;param name="args.copycss" value="yes"/&gt;
  25. &lt;param name="args.css" value="dita-ot-doc.css"/&gt;
  26. &lt;param name="args.csspath" value="css"/&gt;
  27. &lt;param name="args.cssroot" path="../../resources"/&gt;
  28. &lt;param name="args.gen.task.lbl" value="YES"/&gt;
  29. &lt;param name="args.hdr" href="../../resources/header.xml"/&gt;
  30. &lt;param name="html5.toc.generate" value="no"/&gt;
  31. &lt;param name="nav-toc" value="partial"/&gt;
  32. &lt;param name="processing-mode" value="strict"/&gt;
  33. &lt;/publication&gt;
  34. &lt;/deliverable&gt;
  35. &lt;/project&gt;</code></pre>
  36. </figure>
  37. <p class="p">This file can be used to generate the HTML version of the DITA-OT documentation by running the following command
  38. from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
  39. <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>
  40. <p class="p">The project file for HTML output imports the common <code class="ph codeph">html</code> context from a shared project context
  41. 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,
  42. which includes the input map file and the DITAVAL file used to filter the output.</p>
  43. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 2. </span>Sample shared context for HTML-based output</figcaption>
  44. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  45. &lt;?xml-model href="../../../resources/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
  46. &lt;project xmlns="https://www.dita-ot.org/project"&gt;
  47. &lt;context id="html"&gt;
  48. &lt;input href="../../userguide.ditamap"/&gt;
  49. &lt;profile&gt;
  50. &lt;ditaval href="../../resources/html.ditaval"/&gt;
  51. &lt;/profile&gt;
  52. &lt;/context&gt;
  53. &lt;/project&gt;</code></pre>
  54. </figure>
  55. <p class="p">The same common <code class="ph codeph">html</code> context is also referenced in the project file for HTMLHelp output, as
  56. 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>
  57. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 3. </span>Sample project file for HTMLHelp output</figcaption>
  58. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  59. &lt;?xml-model href="../../../resources/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
  60. &lt;project xmlns="https://www.dita-ot.org/project"&gt;
  61. &lt;deliverable name="HTMLHelp" id="htmlhelp"&gt;
  62. &lt;context idref="html"/&gt;
  63. &lt;output href="htmlhelp"/&gt;
  64. &lt;publication transtype="htmlhelp"&gt;
  65. &lt;param name="args.copycss" value="yes"/&gt;
  66. &lt;param name="args.css" value="dita-ot-doc.css"/&gt;
  67. &lt;param name="args.csspath" value="css"/&gt;
  68. &lt;param name="args.cssroot" path="../../resources"/&gt;
  69. &lt;param name="args.gen.task.lbl" value="YES"/&gt;
  70. &lt;param name="processing-mode" value="strict"/&gt;
  71. &lt;/publication&gt;
  72. &lt;/deliverable&gt;
  73. &lt;/project&gt;</code></pre>
  74. </figure>
  75. <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
  76. single PDF deliverable.</p>
  77. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 4. </span>Sample project file for PDF output</figcaption>
  78. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  79. &lt;?xml-model href="../../../resources/project.rnc" type="application/relax-ng-compact-syntax"?&gt;
  80. &lt;project xmlns="https://www.dita-ot.org/project"&gt;
  81. &lt;deliverable id="pdf"&gt;
  82. &lt;context&gt;
  83. &lt;input href="../../userguide-book.ditamap"/&gt;
  84. &lt;/context&gt;
  85. &lt;output href="."/&gt;
  86. &lt;publication transtype="pdf2"&gt;
  87. &lt;param name="args.chapter.layout" value="BASIC"/&gt;
  88. &lt;param name="args.gen.task.lbl" value="YES"/&gt;
  89. &lt;param name="include.rellinks" value="friend"/&gt;
  90. &lt;param name="outputFile.base" value="userguide"/&gt;
  91. &lt;param name="processing-mode" value="strict"/&gt;
  92. &lt;/publication&gt;
  93. &lt;/deliverable&gt;
  94. &lt;/project&gt;</code></pre>
  95. </figure>
  96. <p class="p">This file can be used to generate the PDF version of the DITA-OT documentation by running the following command
  97. from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
  98. <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>
  99. <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
  100. includes both the HTML and PDF projects as follows:</p>
  101. <pre class="pre codeblock language-xml normalize-space show-whitespace"><code>&lt;project xmlns="https://www.dita-ot.org/project"&gt;
  102. &lt;include href="html.xml"/&gt;
  103. &lt;include href="pdf.xml"/&gt;
  104. &lt;/project&gt;</code></pre>
  105. <p class="p">To build both the HTML and PDF versions of the documentation as included in the distribution package, run the
  106. following command from the <span class="ph filepath">docsrc</span> folder of the DITA-OT installation directory:</p>
  107. <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>
  108. <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
  109. three project deliverables as follows:</p>
  110. <pre class="pre codeblock language-xml normalize-space show-whitespace"><code>&lt;project xmlns="https://www.dita-ot.org/project"&gt;
  111. &lt;include href="html.xml"/&gt;
  112. &lt;include href="htmlhelp.xml"/&gt;
  113. &lt;include href="pdf.xml"/&gt;
  114. &lt;/project&gt;</code></pre>
  115. </div>
  116. <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>