ChunkingContent may be chunked (divided or merged into new output documents) in different ways for the purposes of authoring, for delivering content, and for navigation. For example, something best authored as a set of separate topics may need to be delivered as a single Web page. A map author can use the chunk attribute to split up single documents into component topics or combine multiple topics into a single document as part of output processing.
[edit] Examples of useHere are some examples of potential uses of the chunk attribute:
Parent topic: DITA processing [edit] Usage of the chunk attributeWhen a set of topics is transformed for output using a map, the map author may use the chunk attribute to override whatever default chunking behavior applies. The chunk attribute allows the map author to request that multi-topic documents be broken into multiple documents, and that multiple individual topics be combined into a single document.
The value of the chunk attribute consists of one or more space delimited tokens:
topic, without any other topics (ancestors, descendents, or peers) from within the same document, is selected. The value is ignored when the element it is specified on does not point to a topic.
Note that the set of select–xxxxx token values are only useful when addressing a topic in a document that contains multiple topics. Some tokens or combinations of tokens may not be appropriate for all output types. When unsupported or conflicting tokens are encountered during output processing, warning or error messages should be produced. Recovery from such conflicts or other errors is implementation dependent.
[edit] ExamplesGiven several single topic documents, parent1.dita, parent2.dita, …, child1.dita, child2.dita, …, grandchild1.dita, grandchild2.dita containing topics with ids P1, P2, …, C1, C2, …, GC1, GC2, …., several nested topic documents, nested1.dita, nested2.dita, …, each containing two topics, parent topics with ids N1, N2, … and child topics with ids N1a, N2a, … nested within the parent, and ditabase.dita with the following contents: <dita>
<topic id="X"/>
<topic id="Y">
<topic id="Y1">
<topic id="Y1a"/>
</topic>
<topic id="Y2"/>
</topic>
<topic id="Z">
<topic id="Z1"/>
</topic>
</dita>
map1.ditamap: <map chunk="by-document">
<topicref href="parent1.dita" chunk="to-content">
<topicref href="ditabase.dita#Y1"
chunk="select-topic"/>
</topicref>
</map>
Produces a single output document, parent1.xxxx containing topic P1 with topic Y1, but not topic Y1a nested in it. map2.ditamap: <map chunk="by-document">
<topicref href="parent1.dita" chunk="to-content">
<topicref href="ditabase.dita"
chunk="select-branch"/>
</topicref>
</map>
Produces a single output document, parent1.xxxx containing topic P1, topic Y1 nested within topic P1, and topic Y1a nested within Y1. map3.ditamap: <map chunk="by-topic">
<topicref href="parent1.dita" chunk="to-content">
<topicref href="ditabase.dita#Y1"
chunk="select-document"/>
</topicref>
</map>
Produces a single output document, P1.xxxx, containing topic P1 and topics X, Y, and Z together with their children nested within topic P1. map4.ditamap: <map chunk="by-document">
<topicref href="parent1.dita" copyto="parentchunk">
<topicref href="nested1.dita" chunk="select-branch"/>
</topicref>
</map>
<map chunk="by-document">
<topicref href="parent1.dita"
chunk="to-content" copyto="parentchunk">
<topicref href="child1.dita" chunk="select-branch"/>
<topicref href="child2.dita"
chunk="to-content select-branch"
copyto="child2chunk">
<topicref href="grandchild2.dita"/>
</topicref>
<topicref href="child3.dita">
<topicref href="grandchild3.dita"
chunk="select-branch"/>
</topicref>
</topicref>
</map>
<map>
<topicref href="nested1.dita#N1" copyto="nestedchunk"
chunk="to-content select-topic"/>
</map>
Produces a single output document, nestedchunk.xxxx, which contains topic N1 with no topics nested within. map7.ditamap: <map>
<topichead navtitle="How to do lots of things"
chunk="to-navigation">
<topicref href="parent1.dita"
navtitle="How to set up a web server">
<topicref href="child1.dita"
chunk="select-branch"/>
...
</topicref>
<topicref href="parent2.dita"
navtitle="How to ensure database security">
<topicref href="child2.dita"
chunk="select-branch"/>
...
</topicref>
...
</topicref>
</map>
Produces two navigation chunks, one for P1, C1, … and a second for P2, C2, …. The above example identifies a “how to” for setting up a product as a single unit. The “how to” might be provided both as navigable HTML pages and as a printable PDF attached to the root HTML page.
[edit] Implementation specific tokens and future considerationsAdditional chunk tokens may be added to the DITA Standard in the future. Additional implementation specific tokens may be defined as well. To avoid name conflicts between implementations or with future additions to the standard, implementation specific tokens should consist of a prefix that gives the name or an abbreviation for the implementation followed by a colon followed by the chunking method name. For example: “acme:level2” could be a token for the Acme DITA Toolkit that requests the “level2” chunking method. Parent topic: DITA processing |
