Bug 580751 - Fails to build when a section in an appendix links to a term with and index entry
Summary: Fails to build when a section in an appendix links to a term with and index e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 1.6
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-08 23:26 UTC by Josh
Modified: 2010-11-24 04:16 UTC (History)
4 users (show)

Fixed In Version: publican-1.6.3-0.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-17 18:56:41 UTC
Embargoed:


Attachments (Terms of Use)
The test.fo with the duplicate IDs. (137.68 KB, text/x-xslfo)
2010-04-08 23:26 UTC, Josh
no flags Details

Description Josh 2010-04-08 23:26:33 UTC
Created attachment 405426 [details]
The test.fo with the duplicate IDs.

Description of problem:
If you have a variable list with a term as an entry and the term has an index entry the FOP fails to complete with error: org.apache.fop.fo.ValidationException: file:/path/to/book/test/tmp/en-US/xml/test.fo:119:304: Property id "id562930" previously used; id values must be unique in document.

Version-Release number of selected component (if applicable):
publican-1.6.2-0.fc12.noarch

How reproducible:
Always

Steps to Reproduce:
1. publican create --type=book --name=test
2. add 
<variablelist>
<varlistentry>
<term id="test">
<indexterm><primary>primary</primary><secondary>secondary</secondary></indexterm>
term
</term>
<listitem><para>para</para></listitem>
</varlistentry>
</variablelist>
<para>A link <xref linkend="test"/></para>

to Chapter.xml
3. publican build --langs=en-US --format=pdf
  
Actual results:
org.apache.fop.fo.ValidationException: file:/path/to/book/test/tmp/en-US/xml/test.fo:105:278: Property id "id508178" previously used; id values must be unique in document.
        at org.apache.fop.fo.FObj.checkId(FObj.java:176)
        at org.apache.fop.fo.FObj.startOfNode(FObj.java:156)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:295)
        at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:163)
        at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java:208)
        at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:281)
        at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.comment(ToXMLSAXHandler.java:406)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.comment(AbstractSAXParser.java:670)
        at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.comment(XIncludeHandler.java:817)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:454)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:810)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:740)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:110)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:641)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:712)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:317)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:196)
        Finished pdf


Expected results:
Successfully built pdf with a link to that term.


Additional info:
I have not tested whether it is specific to terms or affects other entries.
Removing either the xref or the indexterm allows the document to be built.

I've attached the produced test.fo

Comment 1 Jeff Fearn 🐞 2010-04-09 00:34:44 UTC
If you xref to an element without an XRefLabel it uses the content of that element as it's content, in this case that includes the indexterm, which has already been given a default ID.

Extra fun is added since we don't support XRefLabel in publican because of translation issues [1].

I'm guessing we will need to override the xref code so it doesn't copy indexterms when creating the text, not sure how long this will take.

You could probably work around it by moving the indexterm on to the listitem until we get a proper fix.

[1] http://jfearn.fedorapeople.org/en-US/Publican/1.5/html/Users_Guide/appe-Users_Guide-Disallowed_elements_and_attributes.html#sect-Users_Guide-Disallowed_elements_and_attributes-Disallowed_attributes

Comment 2 Jeff Fearn 🐞 2010-04-09 00:41:46 UTC
Here is another work around

<variablelist>
<varlistentry>
<term>
<indexterm id="test"><primary>term</primary><secondary>secondary</secondary></indexterm>
term
</term>
<listitem><para>para</para></listitem>
</varlistentry>
</variablelist>
<para>A link <xref linkend="test"/></para>

And you all wonder why I'm crazy.

Comment 3 Josh 2010-04-09 00:54:20 UTC
(In reply to comment #2)
> Here is another work around
> 
> <variablelist>
> <varlistentry>
> <term>
> <indexterm
> id="test"><primary>term</primary><secondary>secondary</secondary></indexterm>
> term
> </term>
> <listitem><para>para</para></listitem>
> </varlistentry>
> </variablelist>
> <para>A link <xref linkend="test"/></para>
> 
> And you all wonder why I'm crazy.    

confirmed, that works for us.  great job.

PS: making my own brand, I'm surprised you're as sane as you are...

Comment 4 Jeff Fearn 🐞 2010-05-10 12:48:36 UTC
I believe this is a bug in the upstream FO XSL.

Had to add ID to <xsl:template match="varlistentry/term">

Had to override:

<xsl:template match="varlistentry/term" mode="xref-to">
<xsl:template match="indexterm" mode="xref-to">
<xsl:template match="primary|secondary|tertiary" mode="xref-to">

Comment 5 Ruediger Landmann 2010-05-11 04:54:30 UTC
Verified that the code sample in the original report builds fine in PDF in 1.6.2.t169

Comment 6 Fedora Update System 2010-05-13 22:20:26 UTC
publican-1.6.3-0.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc13

Comment 7 Fedora Update System 2010-05-13 22:21:45 UTC
publican-1.6.3-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc12

Comment 8 Fedora Update System 2010-05-15 20:36:05 UTC
publican-1.6.3-0.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update publican'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc12

Comment 9 Fedora Update System 2010-05-15 20:45:21 UTC
publican-1.6.3-0.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update publican'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/publican-1.6.3-0.fc13

Comment 10 Fedora Update System 2010-05-17 18:55:18 UTC
publican-1.6.3-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2010-05-17 18:59:11 UTC
publican-1.6.3-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.