Page 1 of 1

problem related to bibliography (bookmap/bibliolist)

Posted: Mon May 02, 2016 7:48 am
by surangamas
Hi Radu:

I created a separate file called "bibliography.dita" that contains a list of cited works or books, and in my ditamap (bookmap), I added "bibliolist" to the backmatter, and use bibliolist's href attribute to link to "bibliography.dita". Although the bibliography page was generated successfully in PDF, it seems however, that the header style of the bibliography page is identical to the style I set for the first page header (which I set in the "insertBodyFirstHeader" template in "custom.xsl").

To put it simply, I have a logo displayed on top of every first page header, and the header of the bibliography page seems to be styled the same way. I tried to set a condition in the "insertBodyFirstHeader" template like this:

Code: Select all

<xsl:template name="insertBodyFirstHeader">
<fo:static-content flow-name="first-body-header" text-align="left">
<xsl:choose>
<xsl:when test="*[contains(@class, ' bookmap/bibliolist ')]" />
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="__body__first__header">
<fo:inline>
<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/vmturbo_logo_big.jpg)" />
</fo:inline>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:static-content>
</xsl:template>
But it didn't work, the logo still shows in the header of the bibliography page, what could be done differently to make this work?

What I want is to not have anything in the header for the bibliography page, any help from you would be appreciated, thank you.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Tue May 03, 2016 5:11 pm
by radu_pisoi
Hi,

Did you analyse the 'stage1.xml' file which is the input of the XSLT stylesheet you want to develop?

This temporary file is generated by the DITA-OT transformation and it is the input to the stylesheets that produce XSL-FO file. Usually,
the temporary folder is cleaned when the transformation finished but you can avoid this by setting the 'clean.temp' parameter to 'no'.

Inspecting this file, you will see that 'bibliography.dita' is expanded in the content of 'stage1.xml' as a normal topic, with 'topic/topic' class.

If you want to inspect the class of the element used in the DITA map you can use the 'map-id' key and the @id of the topic you are processing.

So, for you case I think you should modify the 'xsl:when' clause to something like that:

Code: Select all

<xsl:when test="*[contains(key('map-id', @id)[1]/@class, ' bookmap/bibliolist ')]" />

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Tue May 03, 2016 10:28 pm
by surangamas
Hi Radu:
Thank you for the reply, I followed your instruction and replace <xsl:when> with your code:

Code: Select all

<xsl:when test="*[contains(key('map-id', @id)[1]/@class, ' bookmap/bibliolist ')]" />
, the entire code looks like this:

Code: Select all

<xsl:template name="insertBodyFirstHeader">
<fo:static-content flow-name="first-body-header" text-align="left">
<fo:block xsl:use-attribute-sets="__body__first__header">
<xsl:choose>
<xsl:when test="*[contains(key('map-id', @id)[1]/@class, ' bookmap/bibliolist ')]" />
<xsl:otherwise>
<fo:block>
<fo:inline>
<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/xxx.jpg)" />
</fo:inline>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:static-content>
</xsl:template>
But the resulting PDF was still produced the same way: the header logo appears on the bibliography page as on each chapter's first page, I checked stage1.xml, and yes "bibliography.dita" was still treated as a regular topic (type="topic"), do you think that might have something to do with the fact that "bibliography.dita" was created using a DITA topic template?

I can send you files offline if you are interested in having a look, thanks again!

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Wed May 04, 2016 3:20 am
by surangamas
Hi Radu:

One thing I didn't quite understand from your reply is this : "If you want to inspect the class of the element used in the DITA map you can use the 'map-id' key and the @id of the topic you are processing."

Exactly what do I have to do to my DITA map? Thanks.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Thu May 05, 2016 11:42 am
by radu_pisoi
Hi,

The XPath expression that I have suggested you is wrong. The correct one is:

Code: Select all

<xsl:when test="contains(key('map-id', @id)[1]/@class, ' bookmap/bibliolist ')">
One thing I didn't quite understand from your reply is this : "If you want to inspect the class of the element used in the DITA map you can use the 'map-id' key and the @id of the topic you are processing."

Exactly what do I have to do to my DITA map? Thanks.
You should not modify anything in your DITA map. What I've wanted to say is when you have problems to customize the PDF plugin, a stating point could be to inspect the temporary 'stage1.xml' file that is the input of the XSLT transformation.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Thu May 05, 2016 2:06 pm
by surangamas
Hi Radu:

Thanks for the help, although your XPath was good, but it didn't resolve my problem: I still see the logo on the header of the bibliography page.
I checked "stage1.xml", the Bibliography page was still treated like any other topic, so I guess that was why the parser treated it as the first-page header, and output a logo to it.

How were the figurelist page or the index page designed? Since they are also parts of the backmatter, I would say that the bibliography page should also be treated the same as, say a figurelist page, right? But it wasn't.

What would the solution be? Thank you.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Thu May 05, 2016 3:16 pm
by surangamas
I guess the ultimate resolution is to let the parser know that the bibliography page should be treated just like an index or figure list page, instead of a regular topic.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Thu May 05, 2016 5:45 pm
by radu_pisoi
surangamas wrote:I guess the ultimate resolution is to let the parser know that the bibliography page should be treated just like an index or figure list page, instead of a regular topic.
I have added an issue to the DITA-OT project for this improvement: Use for 'bibliolist' the same styling as for 'figurelist or 'indexlist' in the PDF output.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Thu May 05, 2016 7:09 pm
by surangamas
Great, thank you! Please keep us posted of this update.

Re: problem related to bibliography (bookmap/bibliolist)

Posted: Sun Jan 08, 2017 4:00 am
by slupka
write sample "bibliography.dita". Thank
surangamas wrote:Hi Radu:

I created a separate file called "bibliography.dita" that contains a list of cited works or books, and in my ditamap (bookmap), I added "bibliolist" to the backmatter, and use bibliolist's href attribute to link to "bibliography.dita". Although the bibliography page was generated successfully in PDF, it seems however, that the header style of the bibliography page is identical to the style I set for the first page header (which I set in the "insertBodyFirstHeader" template in "custom.xsl").

To put it simply, I have a logo displayed on top of every first page header, and the header of the bibliography page seems to be styled the same way. I tried to set a condition in the "insertBodyFirstHeader" template like this:

Code: Select all

<xsl:template name="insertBodyFirstHeader">
<fo:static-content flow-name="first-body-header" text-align="left">
<xsl:choose>
<xsl:when test="*[contains(@class, ' bookmap/bibliolist ')]" />
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="__body__first__header">
<fo:inline>
<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/vmturbo_logo_big.jpg)" />
</fo:inline>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:static-content>
</xsl:template>
But it didn't work, the logo still shows in the header of the bibliography page, what could be done differently to make this work?

What I want is to not have anything in the header for the bibliography page, any help from you would be appreciated, thank you.