Bug 697367

Summary: Include DocBook 5-compatible Common Content
Product: [Community] Publican Reporter: Ruediger Landmann <rlandman>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Ruediger Landmann <rlandman+disabled>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.5CC: dmacpher, mmcallis, publican-list, sgordon
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-31 03:11:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 820023, 839113    

Description Ruediger Landmann 2011-04-18 03:34:18 UTC
Publican's Common Content files are not compatible with DocBook 5 documents. Specifically:

* the id= attribute is now xml:id
* <ulink url=""> is now  <link xlink:href="">

Comment 1 Jeff Fearn 🐞 2011-04-18 05:07:54 UTC
The problem is bigger than ID's, we will actually need to have a completely separate "brand" for docbook 5 common content.

As a start for this I've added a new brand config option, base_brand, to allow multiple base brands.

We still need to ahve a separate common content, as well as separate XSL.

We will need a decent sized book to test this on.

Comment 2 Jeff Fearn 🐞 2011-04-18 22:40:41 UTC
Consider abandoning DocBook 4 support in Publican 3, and modifying old2new to do DocBook 4 -> DocBook 5 conversions.

Comment 3 Jeff Fearn 🐞 2012-03-12 04:32:58 UTC
Added datadir/Common_Content/common-db5 with DB5 converted content.
Added bin/db4-2-db5 and datadir/xsl/db4-upgrade.xsl to do conversion.

For DB4 books being converted the brand needs to be changed from common to common-db5.

Brands for DB5 should set base_brand to common-db5.

Needs lots of testing.

Comment 4 Jared MORGAN 2012-05-08 04:34:44 UTC
(In reply to comment #3)
> Added datadir/Common_Content/common-db5 with DB5 converted content.
> Added bin/db4-2-db5 and datadir/xsl/db4-upgrade.xsl to do conversion.
> 
> For DB4 books being converted the brand needs to be changed from common to
> common-db5.
> 
> Brands for DB5 should set base_brand to common-db5.
> 
> Needs lots of testing.

Can you give us somewhere to start with testing this please Jeff (doing this for me and others, depending on who picks this ticket up).

Where are the new, shiny, Docbook 5 brands? Is it the publican-experimental brand we need?

[noob question] Tips for compiling a brand (same as building publican?) for Docbook 5 outuput.

Items to test:

* the id= attribute is now xml:id
* <ulink url=""> is now  <link xlink:href="">
* the conversion script, and what it has missed (if anything).

Comment 5 Jeff Fearn 🐞 2012-05-08 07:33:22 UTC
There is a bug in deploying the DB5 common brand, which should be enough for testing. The installer is broken and I need to fix it.

Comment 6 Dan Macpherson 2012-06-16 05:04:43 UTC
Documentation possibly needed for old2new DB4 -> DB5 conversion.

Comment 7 Jeff Fearn 🐞 2012-06-23 07:06:49 UTC
Fixed common-db5 brand not being installed.

To convert a publican book's XML to DB5, cd in to the book directory and run `db4-2-db5`.

Then edit the publican.cfg:

brand: common-db5
dtdver: 5.0

Then do a test build:

$ publican build --langs en-US --formats test

It will probably complain because the Book_Info will duplicate content, just remove the xi:include to it.

It will probably complain about other things, but this is a tech preview :)

Force it build the HTML:

$ publican build --langs en-US --formats html --novalid 

The build will be slow if you don't have the DocBook 5 packages installed. i don't want to make them mandatory yet so they won't be automatically installed.

Note I tested this with dtdver: 5.1b2, seemed to work OK as well.

To ssh://git.fedorahosted.org/git/publican.git
   762f306..a26921c  master -> master

Comment 8 Ruediger Landmann 2012-06-29 05:30:10 UTC
I also had to exclude the Revision_History.xml file to avoid:

RelaxNG Validation failed: 
Revision_History.xml:8: Relax-NG validity error : Did not expect element simpara there                                                                   
Revision_History.xml:8: Relax-NG validity error : Expecting element example, got simpara                                                                 
Revision_History.xml:8: Relax-NG validity error : Expecting element bridgehead, got simpara                                                              
Revision_History.xml:9: Relax-NG validity error : Element simpara has extra content: revhistory                                                          
Revision_History.xml:8: Relax-NG validity error : Expecting element annotation, got simpara 

After that, worked as expected for 5.0

For 5.1b2, the build failed at:

FATAL ERROR: parser:60 in http://docbook.org/xml/5.1b2/rng/docbook.rng on line 2: Content error in the external subset
 at /usr/bin/publican line 879

Jeff, do you want to look at that Revision_History issue? or is that something to worry about later on?

Comment 9 Ruediger Landmann 2012-06-29 05:36:43 UTC
Heh; and 5.1b7 fails in a new and different way:

FATAL ERROR: parser:60 in http://docbook.org/xml/5.1b7/rng/docbook.rng on line 1: Content error in the external subset

Comment 10 Andrew Ross 2012-07-18 02:22:01 UTC
(In reply to comment #9)
> Heh; and 5.1b7 fails in a new and different way:
> 
> FATAL ERROR: parser:60 in http://docbook.org/xml/5.1b7/rng/docbook.rng on
> line 1: Content error in the external subset

Rudi does this mean we should move the bug back to ASSIGNED?

Comment 11 Jeff Fearn 🐞 2012-07-18 02:26:28 UTC
This is a tech preview, I don't care if needs tweaking by the user to get it working.

Comment 12 Stephen Gordon 2013-09-19 02:15:27 UTC
(In reply to Ruediger Landmann from comment #9)

> FATAL ERROR: parser:60 in http://docbook.org/xml/5.1b7/rng/docbook.rng on
> line 1: Content error in the external subset

To any other lucky winners who come across this bug via the googles I was encountering this error on the 5.0 schema (as opposed to 5.1b7 in the example above) but found that switching the dtdver to 5.1 proper seemed to resolve the issue (this was on Publican 3.1.2). No other file or library changes were required, YMMV.