Defining Additional Profile

The previous example is fine for small and average documents. But suppose there is a large document where ContentMap thee will be very large. Navigating in such tree may be difficult. Different views in ContentMap which show only parts of the document might help greatly.

See example ContentMap with Profiles.

Figure 1. ContentMap With Two Profiles



ContentMap with Profiles

This is exactly what can be done using CSL profiles. Let's define two profiles: default one, and another one named " titles". First profile will show the whole document. Second profile will show only elements that have titles.

<?xml version='1.0'?>
<csl:stylesheet xmlns:csl="http://www.syntext.com/Extensions/CSL-1.0">

    <csl:profile icon="toc_icon" inscription="Content Map"/>
    <csl:profile name="titles" inscription="Titles"/>

    <csl:template match="title" 
                  font-style="italic" 
                  font-weight="bold">
        <csl:collect-text/>
    </csl:template>

    <csl:template match="*">
        <csl:collect-text select="text()"/>
        <csl:when-closed>        
            <csl:collect-text/>
        </csl:when-closed>
    </csl:template>

    <csl:template match="*[title]" profiles="titles">
        <csl:collect-text select="title"/>
    </csl:template>

    <csl:template match="/*" profiles="titles">
        <csl:collect-text select="text()"/>
    </csl:template>

</csl:stylesheet>

When this stylesheet is applied, the second tab appears in ContentMap. Look at Figure 1 to see how compact a profiled view may be.