processing-order.html 6.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <html lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2019"><meta name="DC.rights.owner" content="(C) Copyright 2019"><meta name="DC.type" content="concept"><meta name="description" content="The order of processing is often significant when evaluating DITA content. Although the DITA specification does not mandate a specific order for processing, DITA-OT has determined that performing filtering before conref resolution best meets user expectations. Switching the order of processing, while legal, may give different results."><meta name="DC.subject" content=", note, product, conref, resolving, filters, processing order, processing, pipelines"><meta name="keywords" content=", note, product, conref, resolving, filters, processing order, processing, pipelines"><meta name="DC.relation" scheme="URI" content="../reference/architecture.html"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="processing-order"><meta name="DC.language" content="en-US"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Processing order</title></head><body id="processing-order"><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.3</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/alternative-input-formats.html">Authoring formats</a></li><li><a href="../topics/building-output.html">Building output</a></li><li><a href="../parameters/index.html">Setting parameters</a></li><li><a href="../topics/customizing.html">Customizing DITA-OT</a></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a></li><li><a href="../reference/index.html">Reference</a><ul><li><a href="../reference/architecture.html">DITA-OT architecture</a><ul><li><a href="../reference/processing-structure.html">Processing structure</a></li><li><a href="../reference/map-first-preprocessing.html">Map-first preprocessing</a></li><li><a href="../reference/processing-pipeline-modules.html">Processing modules</a></li><li class="active"><a href="../reference/processing-order.html">Processing order</a></li><li><a href="../reference/preprocessing.html">Pre-processing modules</a></li><li><a href="../reference/XhtmlWithNavigation.html">HTML-based processing modules</a></li><li><a href="../reference/pdf-transform.html">PDF processing modules</a></li></ul></li><li><a href="../reference/DITA_spec-support.html">DITA specification support</a></li><li><a href="../reference/license.html">License</a></li></ul></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">Processing order</h1>
  8. <div class="body conbody"><p class="shortdesc">The order of processing is often significant when evaluating DITA content. Although the DITA specification
  9. does not mandate a specific order for processing, DITA-OT has determined that performing filtering before conref
  10. resolution best meets user expectations. Switching the order of processing, while legal, may give different
  11. results.</p>
  12. <section class="section">
  13. <div class="p">The DITA-OT project has found that filtering first provides several benefits. Consider the following sample
  14. that contains a <code class="keyword markupname xmlelement">&lt;note&gt;</code> element that both uses conref and contains a
  15. <code class="keyword markupname xmlatt">@product</code>
  16. attribute:<pre class="pre codeblock language-xml"><code>&lt;note conref="documentA.dita#doc/note" product="MyProd"/&gt;</code></pre></div>
  17. <p class="p">If the <code class="keyword markupname xmlatt">@conref</code> attribute is evaluated first, then documentA must be parsed in order to retrieve
  18. the note content. That content is then stored in the current document (or in a representation of that document
  19. in memory). However, if all content with product="MyProd" is filtered out, then that work is all discarded later
  20. in the build.</p>
  21. <div class="p">If the filtering is done first (as in DITA-OT), this element is discarded immediately, and documentA is never
  22. examined. This provides several important benefits:
  23. <ul class="ul">
  24. <li class="li">Time is saved by discarding unused content as early as possible; all future steps can load the document
  25. without this extra content.</li>
  26. <li class="li">Additional time is saved case by not evaluating the <code class="keyword markupname xmlatt">@conref</code> attribute; in fact, documentA
  27. does not even need to be parsed.</li>
  28. <li class="li">Any user reproducing this build does not need documentA. If the content is sent to a translation team,
  29. that team can reproduce an error-free build without documentA; this means documentA can be kept back from
  30. translation, preventing accidental translation and increased costs.</li>
  31. </ul></div>
  32. <div class="p">If the order of these two steps is reversed, so that conref is evaluated first, it is possible that results
  33. will differ. For example, in the code sample above, the <code class="keyword markupname xmlatt">@product</code> attribute on the reference
  34. target will override the product setting on the referencing note. Assume that the referenced
  35. <code class="keyword markupname xmlelement">&lt;note&gt;</code> element in documentA is defined as follows:
  36. <pre class="pre codeblock language-xml"><code>&lt;note id="note" product="SomeOtherProduct"&gt;This is an important note!&lt;/note&gt;</code></pre></div>
  37. <p class="p">A process that filters out product="SomeOtherProduct" will remove the target of the original conref before that
  38. conref is ever evaluated, which will result in a broken reference. Evaluating conref first would resolve the
  39. reference, and only later filter out the target of the conref. While some use cases can be found where this is
  40. the desired behavior, benefits such as those described above resulted in the current processing order used by
  41. DITA-OT.</p>
  42. </section>
  43. </div>
  44. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../reference/architecture.html" title="DITA Open Toolkit is an open-source implementation of the OASIS specification for the Darwin Information Typing Architecture. The toolkit uses Ant, XSLT, and Java to transform DITA content (maps and topics) into different deliverable formats.">DITA Open Toolkit Architecture</a></div></div></nav></article></main></body></html>