Bookmaps are incorrectly numbered in PDF output, how can I debug this?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 114
- Joined: Wed Mar 17, 2010 1:04 pm
Bookmaps are incorrectly numbered in PDF output, how can I debug this?
Hi,
I am trying to create PDF output with topic numbers, and the PDF bookmarks are still incorrectly numbered if a bookmap contains parts. In this case, the chapters are assigned the number of the previous part:
VII Part Heading
VII Chapter Heading
1.1 Topic Heading
...
VII Another Chapter Heading
2.1 Another Topic Heading
I am using a piece of code from a book on DITA print output:
This line of code could be wrong (because I am not really interested in the top level topic if the chapter is within a part):
Is it possible to debug my transformation scenario? My configuration is as follows:
Thanks for any felp
Susanne
I am trying to create PDF output with topic numbers, and the PDF bookmarks are still incorrectly numbered if a bookmap contains parts. In this case, the chapters are assigned the number of the previous part:
VII Part Heading
VII Chapter Heading
1.1 Topic Heading
...
VII Another Chapter Heading
2.1 Another Topic Heading
I am using a piece of code from a book on DITA print output:
Code: Select all
<xsl:template name="getChapterPrefix">
<xsl:variable name="topicType">
<xsl:call-template name="determineTopicType"/>
</xsl:variable>
<!-- Looks back up the document tree to find which top-level topic I'm nested in. -->
<xsl:variable name="containingChapter" select="ancestor-or-self::*[contains(@class, ' topic/topic')][position()=last()]"/>
<!-- And get the id of that chapter. I'll need it later. -->
<xsl:variable name="id" select="$containingChapter/@id"/>
<!-- Get the chapters and appendixes from the merged map because, at this point, I don't
know whether the topic I'm in is inside a chapter or an appendix or a part. -->
<xsl:variable name="topicChapters">
<xsl:copy-of select="$map//*[contains(@class, ' bookmap/chapter')]"/>
</xsl:variable>
<xsl:variable name="topicAppendices">
<xsl:copy-of select="$map//*[contains(@class, ' bookmap/appendix')]"/>
</xsl:variable>
<xsl:variable name="topicParts">
<xsl:copy-of select="$map//*[contains(@class, ' bookmap/part')]"/>
</xsl:variable>
<!-- Figure out the chapter number. -->
<xsl:variable name="chapterNumber">
<xsl:choose>
<!-- If there's something in $topicChapters with an id that matches the id of the
context node, then I'm inside a chapter. -->
<xsl:when test="$topicChapters/*[@id = $id]">
<xsl:number format="1" value="count($topicChapters/*[@id =$id]/preceding-sibling::*) + 1"/>
</xsl:when>
<!-- If there's something in $topicAppendices with an id that matches the id of
the context node, then I'm inside an appendix. -->
<xsl:when test="$topicAppendices/*[@id = $id]">
<xsl:number format="A" value="count($topicAppendices/*[@id =$id]/preceding-sibling::*) + 1"/>
</xsl:when>
<!-- If there's something in $topicParts with an id that matches the id of the context node,
then I'm inside a part. -->
<xsl:when test="$topicParts/*[@id = $id]">
<xsl:number format="I" value="count($topicParts/*[@id =$id]/preceding-sibling::*) + 1"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- If $chapterNumber is defined, return it.-->
<xsl:choose>
<xsl:when test="$chapterNumber != ''">
<xsl:value-of select="$chapterNumber"/>
</xsl:when>
</xsl:choose>
</xsl:template>
Code: Select all
<!-- Looks back up the document tree to find which top-level topic I'm nested in. -->
<xsl:variable name="containingChapter" select="ancestor-or-self::*[contains(@class, ' topic/topic')][position()=last()]"/>
- external DITA OT 2.5.4
- customization plugin/custom transtype
- RenderX XEP
Thanks for any felp
Susanne
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service