Example: Index descendants of topic element with outputclass
This example shows how to configure the indexes for reusable content.
With these changes, IXIA CCMS indexes descendant elements
of the <topic>
element that have outputclass=“referable”
in addition to referable-content topics.
This change is useful if you want to use one of the standard topic types, such as topic, concept, task, reference, troubleshooting, as sources for conrefs, but you want only certain topic types and elements to be available.
Configuration changes
The lines of code that you need to add for this change are in bold:
<index NAME="reusable_element_id">
<stringindex KEEPEXTRACTEDVALUES="True">
<elements>
<element DEPTH="INFINITE" XPATH="//rcbody/*[@id]/@id"/>
<element DEPTH="INFINITE" XPATH="//glossentry//*[@id]/@id"/>
<element DEPTH="INFINITE" XPATH="//topic[@outputclass='referable']//*[@id]/@id"/>
</elements>
</stringindex>
</index>
<index NAME="reusable_element_name">
<stringindex KEEPEXTRACTEDVALUES="True">
<elements>
<element DEPTH="INFINITE" XPATH="for $e in (//rcbody/*[@id]) return local-name($e)"/>
<element DEPTH="INFINITE" XPATH="for $e in (//glossentry//*[@id]) return local-name($e)"/>
<element DEPTH="INFINITE" XPATH="for $e in (//topic[@outputclass='referable']//*[@id]) return local-name($e)"/>
</elements>
</stringindex>
</index>
<index NAME="reusable_fulltext">
<!-- System index required by the DITA CMS -->
<admindescription>Fulltext index on the documents</admindescription>
<wordindex>
<elements>
<element DEPTH="INFINITE" XPATH="//rcbody/*"/>
<element DEPTH="INFINITE" XPATH="//glossentry//*"/>
<element DEPTH="INFINITE" XPATH="//topic[@outputclass='referable']//*"/>
</elements>
</wordindex>
</index>
<unit NAME="reusable_units">
<unitelements>
<unitelement XPATH="//rcbody/*[@id]"/>
<unitelement XPATH="//glossentry//*[@id]"/>
<unitelement XPATH="//topic[@outputclass='referable']//*[@id]"/>
</unitelements>
</unit>
Index elements
The root <topic>
element of the topic has
outputclass=“referable”
, and the first two
<p>
elements have an id
attribute.
Sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//IXIA//DTD IXIA DITA Composite//EN" "IxiaDitabase.dtd">
<topic id="ndl1584480497414" xml:lang="en-us" outputclass="referable">
<title ixia_locid="1">Salvia</title>
<body>
<p ixia_locid="2" id="para1"><i ixia_locid="3">From Wikipedia, the free encyclopedia.</i></p>
<p ixia_locid="4" id="para2"><b ixia_locid="5">Salvia</b><indexterm ixia_locid="6">flowers<indexterm ixia_locid="7">autumn<indexterm ixia_locid="8">salvia</indexterm></indexterm></indexterm> is the largest <xref format="dita" ixia_locid="9" keyref="genus">genus</xref> of plants in the mint family,
<b ixia_locid="10"><?oxy_comment_start author="Mary" timestamp="20120510T124943+0300" comment="The correct term is Lamiaceae."?>Lamiac<?oxy_insert_start author="Mary" timestamp="20120510T124928+0300"?>e<?oxy_insert_end ?>ae<?oxy_comment_end ?></b>,
with approximately 900 species of shrubs, herbaceous perennials, and annuals. It is one of three genera commonly referred to as sage. When used without modifiers,
Both <p>
elements are included in an index.