Example: Index children of glossentry topics
This example shows how to configure the indexes for reusable content. With these changes, IXIA CCMS makes an index of referable-content topics plus the immediate children of glossentry topics, but not all ancestors.
Configuration changes
Note: 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"/>
</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)"/>
</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/*"/>
</elements>
</wordindex>
</index>
<unit NAME="reusable_units">
<unitelements>
<unitelement XPATH="//rcbody/*[@id]"/>
<unitelement XPATH="//glossentry/*[@id]"/>
</unitelements>
</unit>
Index elements
<glossterm>
and the <p>
inside
<glossdef>
have an id
attribute.
Sample XML:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE glossentry PUBLIC "-//IXIA//DTD IXIA DITA Composite//EN" "IxiaDitabase.dtd">
<glossentry id="mks1584480498040" xml:lang="en-us">
<glossterm ixia_locid="1">Perennial</glossterm>
<glossdef ixia_locid="2">
<p ixia_locid="3" id="perennial-def">A <term ixia_locid="4">perennial plant</term> or <term ixia_locid="5">perennial</term> is a plant that lives for more than two years. When used by gardeners or horticulturists, this term applies specifically to perennial herbaceous plants. Scientifically, woody plants like shrubs and trees are also perennial in their habit.</p>
</glossdef>
</glossentry>
Both the
<glossterm>
and the <p>
are in an
index and appear as reusable content. However, neither appear as reusable content.
<glossdef>
does not have anid
attribute<p>
is a grandchild of<rcbody>
and not a child
If <glossdef>
had an id
attribute, it is
included in an index. But this configuration change alone ignores elements like
<p>
.