Next in thread → Next in month →

Re: [docbook-apps] Multiple bibliographies - FOP error because of non-unique ids

From
"Cob Rtayton"
Date
2008-04-01T22:58:17+00:00
ID
5CEED330C3C4404A8BDC58F50C7EAEF5@sheeta
Thread
Re: [docbook-apps] Multiple bibliographies - FOP error because of non-unique ids
Hi,
Yes, there may be a solution to this problem.  There is a small 
customization that makes id values unique in the output, used primarily for 
multiple instances of an XIncluded element.  See this reference for details:

http://www.sagehill.net/docbookxsl/DuplicateIDs.html#ModifyIdValues

However, I don't think it works without further work with multiple instances 
from a bibliography collection.  In the bibliomixed template in 
fo/biblio.xsl:

<xsl:template match="bibliomixed">
  <xsl:param name="label">
    <xsl:call-template name="biblioentry.label"/>
  </xsl:param>

  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

  <xsl:choose>
    <xsl:when test="string(.) = ''">
      <xsl:variable name="bib" 
select="document($bibliography.collection,.)"/>
      <xsl:variable name="entry" select="$bib/bibliography/
                                         *[@id=$id or @xml:id=$id][1]"/>

The $id will be the modified value, but you can see that $id is used in the 
lookup from the database.  But it won't match any @id in the collection. 
You'll need to customize this template to preserve the original @id of the 
empty bibliomixed to compare it to the @id in the collection, and then let 
the template use $id from the object.id template (the modified version) in 
the output when the element is processed.

Bob Stayton
Sagehill Enterprises


----- Original Message ----- 
From: "Jürgen Klein" <>
To: <>
Sent: Tuesday, April 01, 2008 1:09 PM
Subject: [docbook-apps] Multiple bibliographies - FOP error because of 
non-unique ids

Hi,
we use DocBook xsl-stylesheets (1.72.0), xalan (2.6.0) and fop fop-0.94.
Therewith we try to generate PDF from DocBook-article within multiple
bibliography-elements. In source-xml, we have empty bibliomixed-elements
with id-attributes:
<article>...
<section id="first">...
<bibliography>
<bibliomixed id="DOC2008"/>
</bibliography>
...</section>...
<section id="third">...
<bibliography>
<bibliomixed id="DOC2008"/>
</bibliography>
</section>...
</article>

Bibliography entries are pulled in by bibliomixed-id from a separate
DocBook-bibliography-database (DocBook-document with a collection of
bibliography entries). Ids in the DocBook-bibliography-database are unique.
Ids in source-xml (DocBook-article) can't be unique (e.g.'DOC2008', see
above). Nevertheless, it's no problem to generate FO. While generating PDF
from this FO, FOP, unfortunately, causes an error: "Property id "DOC2008"
previously used; id values must be unique in document".

Is there a way to get rid of this error? Is there another way to use
multiple bibliography-elements in DocBook and generate PDF, even though
bibliomixed-ids in source-xml can't be unique?

Thanks in advance,
Jürgen Klein

---------------------------------------------------------------------
To unsubscribe, e-mail: 
For additional commands, e-mail: 
Next in thread → Next in month →