One Chapter/Topic with different overall formatting in a Bookmap
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 23
- Joined: Wed Nov 18, 2015 6:43 pm
One Chapter/Topic with different overall formatting in a Bookmap
Hi there,
I have a Bookmap with the structure as below:
My question is, for those chapters inside part1, can I format them differently than the rest of the topics/parts in the rest of the books?
I was thinking about adding an outputclass to those as follows:
Then in file attr-set-reflection.xsl, I found the section that triggers the topics styles, i.e.:
Are these the sections where i have to put a conditional for this to work?
I will create new attrributes/styles, i.e. section.topic.topic.topic.title, but how do I add the conditional into attr-set-reflection.xsl and is this the right approach?
Thanks for all your help,
I have a Bookmap with the structure as below:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN"
"bookmap.dtd">
<bookmap xml:lang="en">
<!-- METADATA HERE -->
<part format="dita" href="Part1.xml"/>
<chapter format="ditamap" href="Section1-1.ditamap"/>
<chapter format="ditamap" href="Section2-2.ditamap"/>
<chapter format="ditamap" href="Section3-3.ditamap"/>
</part>
<part format="ditamap" href="Part2.ditamap"/>
<part format="ditamap" href="Part3.ditamap"/>
<part format="ditamap" href="Part4.ditamap"/>
<appendix format="ditamap" href="AppendixA.ditamap"/>
</bookmap>
I was thinking about adding an outputclass to those as follows:
Code: Select all
<chapter format="ditamap" href="Section1-1.ditamap" outputclass="section"/>
<chapter format="ditamap" href="Section2-2.ditamap" outputclass="section"/>
<chapter format="ditamap" href="Section3-3.ditamap" outputclass="section"/>
Code: Select all
....
<xsl:when test="$attrSet = 'topic.topic.topic.title'">
<xsl:call-template name="new-attr-set-reflection">
<xsl:with-param name="temp-element">
<xsl:element name="placeholder" use-attribute-sets="topic.topic.topic.title"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
....
I will create new attrributes/styles, i.e. section.topic.topic.topic.title, but how do I add the conditional into attr-set-reflection.xsl and is this the right approach?
Thanks for all your help,
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: One Chapter/Topic with different overall formatting in a Bookmap
Post by radu_pisoi »
Maybe another solution is to override the template processTopicChapter from commons.xsl. This is the template used to process chapters from a bookmap.
In this template you should check if the current topic has the output class that you previously set. To accomplish that, you should verify if the input document contains a chapter with the same id as the current processed topic and also with the specified output class. The XPath condition: //chapter[@id=$cTopic/@id][@outputclass='section'] where $cTopic is the current processed topic. Please see that stage1a.xml file from the temporary folder. It is used as input for this transformation.
If all the above condition are fulfilled, you could style the current chapter as you wish by adding your custom attribute sets.
In this template you should check if the current topic has the output class that you previously set. To accomplish that, you should verify if the input document contains a chapter with the same id as the current processed topic and also with the specified output class. The XPath condition: //chapter[@id=$cTopic/@id][@outputclass='section'] where $cTopic is the current processed topic. Please see that stage1a.xml file from the temporary folder. It is used as input for this transformation.
If all the above condition are fulfilled, you could style the current chapter as you wish by adding your custom attribute sets.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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