DocBook, TOC for 2 different books?

Oxygen general issues.
dinodc
Posts: 19
Joined: Fri Apr 18, 2014 1:07 am
Contact:

DocBook, TOC for 2 different books?

Post by dinodc »

Hi guys!

Question about DocBook. In our documentation project we have 2 books that output 2 different pdf files. In the that project, there is a XSL folder which contains the docbook.xsl file. That file helps format our TOC(Table of Content). We found out that when we added a line in the docbook.xsl to change the default section-level from 2 to 3, it of course changed both books to the section-level to 3 for the TOC.

Code: Select all

	<xsl:param name="toc.section.depth">3</xsl:param>
Question: Can I have it so each book has its configuration for the TOC. . .one will have a section-level 3 and the other will be a section-level 2? Will both use the docbook.xsl or separate?

Thanks!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: DocBook, TOC for 2 different books?

Post by sorin_ristache »

Hi,

You can use the same docbook.xsl file for both books if you set the toc.section.depth parameter in each PDF transformation when you start it, in the process that calls the docbook.xsl file. In Oxygen that would be the Parameters dialog box. The value set in the docbook.xsl file is only a default value if no other value is set when the docbook.xsl file is called in the XSLT transformation.


Regards,
Sorin
dinodc
Posts: 19
Joined: Fri Apr 18, 2014 1:07 am
Contact:

Re: DocBook, TOC for 2 different books?

Post by dinodc »

sorin wrote:Hi,

You can use the same docbook.xsl file for both books if you set the toc.section.depth parameter in each PDF transformation when you start it, in the process that calls the docbook.xsl file. In Oxygen that would be the Parameters dialog box. The value set in the docbook.xsl file is only a default value if no other value is set when the docbook.xsl file is called in the XSLT transformation.


Regards,
Sorin
Sori,

Thanks for the reply!

You mentioned the Parameters dialog box could be found in Oxygen. Oxygen XML Editor or Author. I'm using Author and I can also use Editor and view with Eclipse as well. As you probably know, we did set the toc.section.depth within our docbook.xsl file. to 3 and both book's TOC went to level 3. I did see there was a XSL and POM.xml file in our project.
dinodc
Posts: 19
Joined: Fri Apr 18, 2014 1:07 am
Contact:

Re: DocBook, TOC for 2 different books?

Post by dinodc »

Below is one of my documents.

Can I set the level of toc in this xml document?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<book version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Manager</title>
<subtitle>Description Document: Usage Rules, and Examples</subtitle>

<info>
<author>
<personname>Name</personname>
</author>
</info>
<xi:include href="overview.xml" />
<xi:include href="plan.xml"/>
<xi:include href="ListOfExamples.xml" />
</book>
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: DocBook, TOC for 2 different books?

Post by sorin_ristache »

Hello,

No, you can't set the toc.section.depth parameter in the Docbook XML document. It is an XSLT transformation parameter, so it must be set as an XSLT parameter.

The XSLT parameter can be set either in the XSLT file (in your docbook.xsl file), as you already did, or in the process that calls the XSLT transformation. If you run the Docbook transformation in an Oxygen application (Editor, Author or Developer) I recommend setting the value of the parameter with the second method (in the Parameters dialog box in the Docbook transformation), i.e. in the process that calls the XSLT transformation, which is the Oxygen application. This is preferrable in your case because it allows you to create two Oxygen transformation scenarios (by duplicating the Docbook PDF transformation) and set different values for the toc.section.depth parameter).

The first method (setting the value of the parameter directly in the XSLT file) does not allow you to run two different transformations with different values of the parameter, this is why I recommended the first method.


Regards,
Sorin
Post Reply