Example: How the @collection-type
and @linking
attributes
determine links
In this scenario, a simple map establishes basic hierarchical and relationship table
links. The @collection-type
and @linking
attributes are then
added to modify how links are generated.
The following example illustrates how linkage is defined in a DITA map:
<topicref href="A.dita" collection-type="sequence">
<topicref href="A1.dita"/>
<topicref href="A2.dita"/>
</topicref>
<reltable>
<relrow>
<relcell><topicref href="A.dita"/></relcell>
<relcell><topicref href="B.dita"/></relcell>
</relrow>
</reltable>
When the output is generated, the topics contain the following linkage. Sequential
(next/previous) links between A1 and A2 are present because of the
@collection-type
attribute on the parent:
- A
- Links to A1, A2 as children
- A1
- Links to A as a parent
- A2
- Links to A as a parent
- B
- Links to A as related
The following example illustrates how setting the @linking
attribute can change
the default behavior:
@linking
attribute<topicref href="A.dita" collection-type="sequence">
<topicref href="B.dita" linking="none"/>
<topicref href="A1.dita"/>
<topicref href="A2.dita"/>
</topicref>
<reltable>
<relrow>
<relcell><topicref href="A.dita"/></relcell>
<relcell linking="sourceonly"><topicref href="B.dita"/></relcell>
</relrow>
</reltable>
When the output is generated, the topics contain the following linkage:
- A
- Links to A1, A2 as children
- A1
- Links to A as a parent
- A2
- Links to A as a parent
- B
- Links to A as a related topic