Required TemplateSpecification.xml changes
Some changes must be made to TemplateSpecification.xml before you can use Publication Manager as a map editor.
Container elements
A container element is an element that contains a set of other elements. These container elements can be visualized in the map editor.
| Attribute | Default value | Description |
|---|---|---|
labelXPath | XPath expression | Indicate the label for the item in the tree. |
<chapter> element as a container element. The <chapter> element will be displayed in the tree view of Publication Manager. Whenever an XML document is loaded containing a <chapter> element, the content of the <title> element (first child element) is displayed in the tree (indicated by the XPath expression ./title)
<templates>
…
<template id="Dita.Chapter.Template.Update" name="chapter">
<label resourceref="Dita.Chapter.Form.Label">Chapter</label>
<labelXPath>./title</labelXPath>
...
<form ref="Dita.Chapter.Form.Update" />
<documentFragment linkFieldName="HRefField">
<chapter href="contentitem:HRefField" format="contentitem:FormatField" ishcondition="contentitem:ConditionField">
<topicmeta>
<navtitle>contentitem:NavTitleField</navtitle>
</topicmeta>
</chapter>
</documentFragment>
</template>
…
<templateGroup> can be used to group templates. A filter element <dtds> can be added to the group to limit the elements that can be inserted or added to a node in the tree view of Publication Manager. Elements can only be added when the DTD of the source document matches one of the <dtd> elements in <dtds>.
<templates>
<templateGroup>
<dtds>
<dtd publicid="-//SDL//DTD DITA Learning Group Map//EN" />
<dtd publicid="-//SDL//DTD DITA Learning Map//EN" />
<dtd publicid="-//SDL//DTD DITA Learning Object Map//EN" />
...
</dtds>
<template id="Dita.LearningGroup.Template.Update" name="learningGroup">…</template>
<template id="Dita.LearningObject.Template.Update" name="learningObject">…</template>
...
</templateGroup>
</templates>
Link elements
| Attribute | Default value | Description |
|---|---|---|
linkXPath | XPath expression | Indicate how the referencing value must be found. |
In the following example we force an element to be interpreted as a link towards a topic. The value of the href attribute will be used for retrieving the content of the topic from the Repository whenever this item is selected in the tree view of the Repository.
...
<template id="Dita.TopicRef.Template.Update" name="topicref">
<label resourceref="Dita.TopicRef.Form.Label">Topic Ref</label>
...
<linkXPath>@href</linkXPath>
<form ref="Dita.TopicRef.Form.Update" />
<documentFragment linkFieldName="HRefField">
<topicref href="contentitem:HRefField" keys="contentitem:KeysField" format="contentitem:FormatField" linking="contentitem:LinkingField" ishcondition="contentitem:ConditionField">
<topicmeta>
<navtitle>contentitem:NavTitleField</navtitle>
</topicmeta>
</topicref>
</documentFragment>
</template>
...