How to get two booktitlealt on two different lines in PDF output
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 14
- Joined: Fri Nov 24, 2017 10:07 am
How to get two booktitlealt on two different lines in PDF output
Hi,
I am working on a plugin with customized PDf styles. We have two booktitlealt in our DITAMap. In the PDF output, I want these booktitlealt on two different rows. However, in my output they are in one line without any space between them. Can you please help?
_____________________________________________________________________________________________________________________________
front-matter.xsl
___________________________________________________________________________________________________________________________
front-matter-aatr.xsl
I am working on a plugin with customized PDf styles. We have two booktitlealt in our DITAMap. In the PDF output, I want these booktitlealt on two different rows. However, in my output they are in one line without any space between them. Can you please help?
_____________________________________________________________________________________________________________________________
front-matter.xsl
Code: Select all
<xsl:template name="createFrontMatter_1.0">
<fo:page-sequence master-reference="front-matter" xsl:use-attribute-sets="__force__page__count">
<xsl:call-template name="insertFrontMatterStaticContents"/>
<fo:flow flow-name="xsl-region-body">
<fo:block xsl:use-attribute-sets="__frontmatter">
<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/ptc_header.png)" width="100%" height="100%" content-width="scale-to-fit" content-height="scale-to-fit" scaling="uniform" />
</fo:block>
<!-- set the title -->
<fo:block xsl:use-attribute-sets="__frontmatter__title">
<xsl:choose>
<xsl:when test="$map/*[contains(@class,' topic/title ')][1]">
<xsl:apply-templates select="$map/*[contains(@class,' topic/title ')][1]"/>
</xsl:when>
<xsl:when test="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]">
<xsl:apply-templates select="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]"/>
</xsl:when>
<xsl:when test="//*[contains(@class, ' map/map ')]/@title">
<xsl:value-of select="//*[contains(@class, ' map/map ')]/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/descendant::*[contains(@class, ' topic/topic ')][1]/*[contains(@class, ' topic/title ')]"/>
</xsl:otherwise>
</xsl:choose>
<!-- set the subtitle -->
<fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
<xsl:apply-templates select="$map//*[contains(@class,' bookmap/booktitlealt ')]"/>
</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>
<xsl:if test="not($retain-bookmap-order)">
<xsl:call-template name="createNotices"/>
</xsl:if>
</xsl:template>
front-matter-aatr.xsl
Code: Select all
<xsl:attribute-set name="__frontmatter__title" use-attribute-sets="common.title">
<xsl:attribute name="space-before">3in</xsl:attribute>
<xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
<xsl:attribute name="font-size">24pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="line-height">140%</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="margin-left">2in</xsl:attribute>
<xsl:attribute name="color">#3D4647</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="__frontmatter__subtitle" use-attribute-sets="common.title">
<xsl:attribute name="font-size">14pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="line-height">140%</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="color">#3D4647</xsl:attribute>
</xsl:attribute-set>
-
- Posts: 145
- Joined: Mon Jun 12, 2017 10:50 am
Re: How to get two booktitlealt on two different lines in PDF output
Post by cosmin_andrei »
Hi Sangeeta,
I could not reproduce the issue you reported.
A DITA code such as:
transformed with the default DITA Map PDF transformation scenario produced a PDF output that looks like this:
files/AltTitle.jpg
This means that most likely the problem originates somewhere in your customization.
I could not reproduce the issue you reported.
A DITA code such as:
Code: Select all
...
<booktitle>
<mainbooktitle>Main Book Title</mainbooktitle>
<booktitlealt>Alt Title 1</booktitlealt>
<booktitlealt>Alt Title 2</booktitlealt>
</booktitle>
...
files/AltTitle.jpg
This means that most likely the problem originates somewhere in your customization.
Regards,
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
-
- Posts: 14
- Joined: Fri Nov 24, 2017 10:07 am
Re: How to get two booktitlealt on two different lines in PDF output
Hi Radu,
Can you please point me to the probable tags/elements where I should check in my customization? I have no clue what could have gone wrong
The code i sent you is only piece i customized for titles.
Best regards,
Sangeeta
Can you please point me to the probable tags/elements where I should check in my customization? I have no clue what could have gone wrong

The code i sent you is only piece i customized for titles.
Best regards,
Sangeeta
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to get two booktitlealt on two different lines in PDF output
Hi,
Maybe if the DITA Map contains multiple booktitlealt's your XSLT customization instead of doing this:
you could add a fo:block for each booktitlealt:
although in the base PDF plugin "front-matter.xsl" there should already be a template which matches the booktitlealt and creates a fo:block:
Regards,
Radu
Maybe if the DITA Map contains multiple booktitlealt's your XSLT customization instead of doing this:
Code: Select all
<fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
<xsl:apply-templates select="$map//*[contains(@class,' bookmap/booktitlealt ')]"/>
</fo:block>
Code: Select all
<xsl:for-each select="$map//*[contains(@class,' bookmap/booktitlealt ')]">
<fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
<xsl:apply-templates select="."/>
</fo:block>
</xsl:for-each>
Code: Select all
<xsl:template match="*[contains(@class, ' bookmap/booktitlealt ')]" priority="2">
<fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 14
- Joined: Fri Nov 24, 2017 10:07 am
Re: How to get two booktitlealt on two different lines in PDF output
Hi Radu,
Thank you so so much! Worked like magic
...
SO in the template with "select", we are reapplying the subtitle style to booktitlealt elements?
Best regards,
Sangeeta
Thank you so so much! Worked like magic

SO in the template with "select", we are reapplying the subtitle style to booktitlealt elements?
Best regards,
Sangeeta
Return to “General XML Questions”
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