Hi Boris,
First, I wanted to check to make sure your stylesheet customization follows the two-part setup required for customizing the chunking templates. This is described in:

http://www.sagehill.net/docbookxsl/ChunkingCustomization.html

If you don't use that setup, you won't be able to customize the chunking behavior of preface.

Assuming you have set up your customization in those two parts, the problem you are running into is from this template in html/chunk-code.xsl:

<xsl:template match="set|book|part|preface|chapter|appendix
                    |article
                    |reference|refentry
                    |book/glossary|article/glossary|part/glossary
                    |book/bibliography|article/bibliography|part/bibliography
                    |colophon">
 <xsl:choose>
   <xsl:when test="$onechunk != 0 and parent::*">
     <xsl:apply-imports/>
   </xsl:when>
   <xsl:otherwise>
     <xsl:call-template name="process-chunk-element"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

This template does not call the "chunk" template to see if the element it is processing is a chunk, so it calls the template named process-chunk-element, and that element then runs the "chunk" template and reports that error.

So you need an additional custom template for preface in the chunk part of your customization that just does the apply-imports:

<xsl:template match="preface" priority="1">
 <xsl:apply-imports/>
</xsl:template>

You need the priority="1" because the chunk customization uses xsl:include of chunk-code.xsl, which would put the new template at the same import level as the original which would generate an ambiguity on the match and possibly fail.

That combination should produce a preface that is not chunked. However, there are other potential problems. For example, the stock DocBook navigational headers and footers will still list the preface as a chunk, even though it is not. If you use the stock headers and footers, you will need to further customize those templates to exclude preface from the computation of next and previous chunks. Those templates are big.

Bob Stayton
Sagehill Enterprises
[EMAIL PROTECTED]


----- Original Message ----- From: "Boris" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, November 28, 2008 5:04 PM
Subject: [docbook-apps] How to make preface not a chunk?


I've a huge customization layer turning a DocBook 5 documentation into a couple of HTML files. I'd like to change the stylesheets now to make the preface not a chunk. I found the template "chunk" in chunk-common.xsl and changed line 1002 to:

<xsl:when test="local-name($node)='preface'">0</xsl:when>

When I process my XML files then I get this error message though:

Error preface is not a chunk!
Writing ../bla/ for preface
I/O error : Is a directory
I/O error : Is a directory
runtime error: file /home/Boris/docbook-xsl-ns-1.74.0/html/chunker.xsl line 136 element document
xsltDocumentElem: unable to save to ../bla/

Does anyone know where the error message comes from (I searched for "is not a chunk" but couldn't find anything in the XSL files)? Or - even better - does anyone know how to make the preface not a chunk?

Boris


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to