Bug 839128

Summary: Docbook 5 schema is hardcoded
Product: [Community] Publican Reporter: Joshua Wulf <jwulf>
Component: publicanAssignee: Jeff Fearn <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0CC: lcarlon, rglasz, rlandman, sgordon, xma
Target Milestone: 3.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: 3.1.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-05 22:40:52 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 839113    

Description Joshua Wulf 2012-07-11 00:37:13 EDT
At the moment Publican 3's Builder.pm hardcodes the schema to be used for validation for Docbook 5:

 if ( $dtdver =~ m/^5/ ) {
        $dtd_type = qq|-//OASIS//DTD DocBook XML $dtdver//EN|;
        $dtd_path = qq|http://docbook.org/xml/$dtdver/rng/docbook.rng|;

I have a customization layer that Norm wrote for me that I'd like to be able to use (https://gist.github.com/2768701).

Can we make it possible to override the default validation schema from the xml?
Comment 1 Jeff Fearn 2013-01-07 20:53:10 EST
This fix has been committed to the devel branch for inclusion in Publican 3.1.

Added dtd_type and dtd_uri parameters, which can be set in brands, to override the strings Publican generates.
Comment 2 Stephen Gordon 2013-01-08 15:20:38 EST
Hi Jeff, does this belong in defaults.cfg, overrides.cfg or publican.cfg in the brand (or some combination of these)?
Comment 3 Stephen Gordon 2013-01-08 15:34:16 EST
Thinking about it more I think as a brand setting the answer must be publican.cfg in the brand but I will test to be sure.
Comment 4 Jeff Fearn 2013-01-08 17:59:50 EST
In a brand publican.cfg affects packaging the brand itself. defaults.cfg & overrides.cfg affect books using that brand.

In this case you want the brand to control what happens in the books, so either defaults.cfg or overrides.cfg will do.
Comment 5 xuezhi ma 2013-01-31 02:19:43 EST
Verify version:publican-3.1.0-0.el6eng.noarch -> PASS

Verify steps:
1. $Publican create_brand --name=test --lang=en-US
2. Add dtd_type and dtd_uri parameters in defaults.cfg of brand, set dtd_uri to https://gist.github.com/2768701 and dtd_type to -//OASIS//DTD DocBook XML 5.0//EN
3. Build the brand and install it to /usr/share/publican/Common_Content/
4. Create a book and set brand: test in publican.cfg.
5. Build the book, then check tmp/en-US/*.xml

Actual results:
Validation schema for Docbook 5 have been changed to what we set.