OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] How can I exclude an "index" page sequence from being processed by an xsl:when statement?

Hi Gregorio,
Thanks for the reply. You are right that the error appears before FOP, I was not being precise. I found several references to this kind of error on the web, but they didn't fit my scenario. Except one, that referred to using an <xsl:apply-templates select="index"/>  statement, like I was doing. I understood that the problem stemmed form the fact that I used two separate page-masters ('body' and 'index'), and that some customized templates/clauses were being processes twice due to this, duplicating part of the document (same ID then appeared twice in the XSLT output).

So I started debugging, and found the clause that was being "duplicated".

Hope I made myself understood, I am not sure I use/know the correct terminology when trying to talk about xsl...

Bob Stayton's suggestion worked for me :-)


On 11/12/2013 19:33, Gregorio Pevaco wrote:

Just a thought, I have seen this error before, and generally (in my case) this has to do with the content. 
Particularly when combining smaller modular docs into a larger book or set. 
We use an ID="attribute" attribute for every section, sect1, sect2, etc. 
When combining sections if there are identical ID="attribute" usually something common like ID="introduction" that is when I see this error. 
Typically this error would not validate so it would surface well before the FOP step. However anything is possible. Are you are doing any transform to the data before running FOP? 

The fix is to use unique labels in the source attribute. 
Not always possible, but that is one possibility to look at. 

Hope it helps. 

-----Original Message-----
From: Øystein Kleven <oystein.kleven@active-circle.com>
To: docbook-apps <docbook-apps@lists.oasis-open.org>
Sent: Wed, Dec 11, 2013 12:32 pm
Subject: [docbook-apps] How can I exclude an "index" page sequence from being processed by an xsl:when statement?

Thanks to a previous post reply from Bob Stayton (https://lists.oasis-open.org/archives/docbook-apps/200804/msg00086.html), I have been able to build an article PDF doc with an index with multiple columns. However, this results in an FOP error:
Property ID "xxxxx" (found on "fo:block") previously used; ID values must be unique within a document!
After debugging, I have narrowed the problem down to the customization of the first xsl:when statement in the "footer.content" template in my custom stylesheet. (see below). If I remove that part (everything between "START" and "END" below), the FO processing succeeds, but the first page footer and the index footer (which is now also a "first" page in its separate page sequence) is of course incorrect, since the customization is missing.

How can I keep the customization, but skip it when the page-sequence is handled as "index"?

(I am (still) using DocBook 4.5 with XSL/FO version 1.73.2)

Template excerpt:

<xsl:template name="footer.content">
    <xsl:param name="pageclass" select="''"/>
    <xsl:param name="sequence" select="''"/>
    <xsl:param name="position" select="''"/>
    <xsl:param name="gentext-key" select="''"/>
    <xsl:param name="master-reference" select="''"/>
        <!-- OKL: This includes/removes the footer content (not the rule line)
                   from the first page (necessary for <article> docs) 
        <!-- START -->
        <xsl:when test="$sequence = 'first'">    
            <xsl:when test="$double.sided = 0 and $position='left'">
              <!-- <fo:page-number/> -->
            <xsl:when test="$double.sided = 0 and $position = 'center'">
              <fo:block text-align="justify">
                <!-- OKL: Insert legal notice in the footer of the first page -->
                <xsl:apply-templates select="//legalnotice[1]" mode="article.titlepage.recto.auto.mode"/>
        <!-- END -->
        <xsl:when test="$pageclass = 'titlepage'">
          <!-- nop; no footer on title pages -->




Øystein Kleven
Active Circle - Documentation
+33 6 60 47 72 61


      AC Logo



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]