Bug 839128 - Docbook 5 schema is hardcoded
Summary: Docbook 5 schema is hardcoded
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.1
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 839113
TreeView+ depends on / blocked
 
Reported: 2012-07-11 04:37 UTC by Joshua Wulf
Modified: 2014-10-19 23:01 UTC (History)
5 users (show)

Fixed In Version: 3.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-06 03:40:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua Wulf 2012-07-11 04:37:13 UTC
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-08 01:53:10 UTC
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 20:20:38 UTC
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 20:34:16 UTC
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 22:59:50 UTC
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 07:19:43 UTC
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.


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