Numbering nested concepts
Posted: Tue Jul 28, 2015 4:05 pm
Hi guys,
I managed with the help of Octavian to have my issue with the page break sorted out, thank you very much, and I encountered another issue that I have to overcome.
Before I was having for everything that was having a title a topic, even if it was a title-topic, and I was having everything numbered properly. However, because our developer team suggested to have less files, I opted for nested concepts architecture in order to reduce the number of files, and to keep the formatting of titles inside the document.
The issue right now is that the main concept, the one containing children concepts nested, is numbered properly, however the nested concepts (I have only one level of nesting) are not numbered at all, and I would like to have them as it was before, if it is not too much work around.
I managed to find a formatting for my common.xsl file, from ...cfg/fo/xsl that was doing the job properly with the old architecture, however with the new architecture, it does not number everything, so I guess it needs some adjustments.
The part I inserted in the xsl file is:
<xsl:template match="*" mode="getTitle">
<xsl:variable name="topic" select="ancestor-or-self::*[contains(@class, ' topic/topic ')][1]" />
<xsl:variable name="id" select="$topic/@id" />
<xsl:variable name="mapTopics" select="key('map-id', $id)" />
<fo:inline>
<xsl:apply-templates select="$mapTopics[1]" mode="topicTitleNumber"/>
</fo:inline>
<xsl:text> </xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]"
mode="topicTitleNumber">
<xsl:number format="1. "
count="*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]
| *[contains(@class, ' bookmap/chapter ')]" level="multiple"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]"
mode="topicTitleNumber">
<xsl:number format="1. "
count="*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]
| *[contains(@class, ' bookmap/chapter ')]" level="multiple"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' bookmap/bookmap ')]/opentopic:map/
*[contains(@class, ' map/topicref
I would highly appreciate if somebody would help me change this or make another one in order to have the nested concepts also numbered.
Thank you very much.
I managed with the help of Octavian to have my issue with the page break sorted out, thank you very much, and I encountered another issue that I have to overcome.
Before I was having for everything that was having a title a topic, even if it was a title-topic, and I was having everything numbered properly. However, because our developer team suggested to have less files, I opted for nested concepts architecture in order to reduce the number of files, and to keep the formatting of titles inside the document.
The issue right now is that the main concept, the one containing children concepts nested, is numbered properly, however the nested concepts (I have only one level of nesting) are not numbered at all, and I would like to have them as it was before, if it is not too much work around.
I managed to find a formatting for my common.xsl file, from ...cfg/fo/xsl that was doing the job properly with the old architecture, however with the new architecture, it does not number everything, so I guess it needs some adjustments.
The part I inserted in the xsl file is:
<xsl:template match="*" mode="getTitle">
<xsl:variable name="topic" select="ancestor-or-self::*[contains(@class, ' topic/topic ')][1]" />
<xsl:variable name="id" select="$topic/@id" />
<xsl:variable name="mapTopics" select="key('map-id', $id)" />
<fo:inline>
<xsl:apply-templates select="$mapTopics[1]" mode="topicTitleNumber"/>
</fo:inline>
<xsl:text> </xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]"
mode="topicTitleNumber">
<xsl:number format="1. "
count="*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]
| *[contains(@class, ' bookmap/chapter ')]" level="multiple"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]"
mode="topicTitleNumber">
<xsl:number format="1. "
count="*[contains(@class, ' map/topicref ')]
[not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]
| *[contains(@class, ' bookmap/chapter ')]" level="multiple"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' bookmap/bookmap ')]/opentopic:map/
*[contains(@class, ' map/topicref
I would highly appreciate if somebody would help me change this or make another one in order to have the nested concepts also numbered.
Thank you very much.