Bug 817729

Summary: Duplicate element ids cause publican build failure
Product: [Community] PressGang CCMS Reporter: Joshua Wulf <jwulf>
Component: CSProcessorAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: jwulf, lcarlon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.24.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-07 01:30:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joshua Wulf 2012-05-01 03:43:27 UTC
If an author specifies an element id in a topic, and that element id is used in another topic, when the two topics are combined in a single output (book), the publican build fails due to duplicated ids.

To reproduce:
1. Create two topics, each containing a table
2. Give the table in each topic the same id attribute
3. Attempt to build a book that includes both topics

Result: 

Something like: 

topics/General_Broker_options.xml:8: validity error : ID tabl-Messaging_Installation_Guide-Setting_Broker_Options-General_Broker_Options already defined


Suggestion:

Rewrite all id elements in topics as the book is assembled. An id element can be used as a target within a topic (example below), so target references can be unambiguously resolved by the builder (namespace is per topic) and rewritten so that they are unambiguous for publican (namespace is per book).

Example of valid use of id as target within a topic:

<section>
<figure id="figure_above">
..
</figure>
<para>In <xref linkend="figure_above"/>, yada yada yada.</para>
</section>

Comment 1 Lee Newson 2012-05-15 23:15:52 UTC
Fixed in 0.24.0

Cause:

The builder was only fixing duplicate ids that existed amongst duplicate topics. 

Consequence:

A build would fail if an id is used twice in different topics.

Fix:

Find all the ids first then check if the id has been duplicated. If it has been duplicated then add a unique identifier to the id and then check the rest of the topic for the old id and replace it with the new id.

Comment 2 Lee Newson 2013-06-07 01:30:15 UTC
Closing and setting as current release as no QA was performed by the original reporter. If there is still an issue with this bug still than please re-open it.