Bug 1053928

Summary: Add Build/XML Validation support for DocBook 5
Product: [Community] PressGang CCMS Reporter: Lee Newson <lnewson>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: mcaspers
Target Milestone: ---   
Target Release: 1.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-23 23:43:50 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:
Bug Depends On:    
Bug Blocks: 1051919    
Attachments:
Description Flags
Customised docbook.rng none

Description Lee Newson 2014-01-16 01:57:07 UTC
The Content Spec builder currently can only build DocBook 4.5 output, so we'll need to add/update any build requirements. We'll also need to update the XML validation used to support xsd schema based validation as it is recommended that Docbook 5 XML be validated against the RELAX-NG schemas (http://www.docbook.org/tdg5/en/html/ch01.html#ex.docbook5). These can be downloaded from http://www.docbook.org/xml/5.0/rng/.

Comment 1 Lee Newson 2014-02-06 03:00:55 UTC
Additional Note that isn't mentioned in the above links is that <revhistory> can no longer be a child of <simpara>. As such it should now be a direct child of <appendix> instead of being wrapped in the <simpara>.

Comment 2 Lee Newson 2014-02-06 03:07:24 UTC
The <author> element also has changed, as <firstname> and <surname> now need to be a child of <personname>. ie:

<author>
    <personname>
        <firstname>Lee</firstname>
        <surname>Newson</surname>
    </personname>
    <email>lnewson</email>
</author>

instead of:

<author>
    <firstname>Lee</firstname>
    <surname>Newson</surname>
    <email>lnewson</email>
</author>

Comment 3 Lee Newson 2014-02-07 05:08:50 UTC
Created attachment 860374 [details]
Customised docbook.rng

Attaching a customised version of the docbook.rng schema which removes the IDREF check on xref linkend attributes. This is required for validation of single topics since the xref won't exist until the book is compiled when using injections.

Comment 4 Lee Newson 2014-02-10 06:37:08 UTC
Another thing to note is that <sectioninfo> elements used to have to be before the <title>. However in DocBook 5.0 they now need to be after the <title> element.

Comment 5 Lee Newson 2014-02-10 07:13:55 UTC
Added in 1.4-SNAPSHOT build 201402101456

The validator will now validate against the DocBook 5.0 Relax NG schema when the Content Spec Format is set to DocBook 5.0.

The builder will also produce DocBook 5.0 valid syntax taking all of the above into account. Additionally to make publican build, the dtdver: "5.0" publican.cfg value is added when building.

Comment 7 Matthew Casperson 2014-02-11 23:58:50 UTC
Confirmed that a DocBook 5 spec with DocBook 5 topics is built by csprocessor and then built by Publican 4.

Comment 8 Matthew Casperson 2014-02-12 00:06:02 UTC
Confirmed that topics that were valid under Docbook 4.5 are now being identified as invalid under docbook 5.0.

Comment 10 Lee Newson 2014-02-12 06:41:31 UTC
Updated the builder to include the DocBook 5.0 namespaces and xlink namespace.

Comment 12 Matthew Casperson 2014-02-12 07:01:16 UTC
Confirmed that the bugzilla links no longer break the Docbook 5 builds. 

I will test some more Docbook 5 content tomorrow.

Comment 14 Lee Newson 2014-02-12 22:55:50 UTC
Fixed the build issue in 1.4-SNAPSHOT build 201402130848

The problem was caused by not adding the DocBook 5.0 namespaces to some of the error templates. This was then causing the validation pass to fail and show the error template in the "Error" chapter, instead of the normal topic XML.

Comment 17 Lee Newson 2014-02-13 03:09:20 UTC
Looks like a wrapping issue, as the content has been wrapped in another <abstract>. Will look into it, thanks Matt.

Comment 26 Matthew Casperson 2014-02-18 05:03:20 UTC
Confirmed that csprocessor 1.4-13 fixes the above issue.

Comment 28 Matthew Casperson 2014-02-18 06:07:46 UTC
Confirmed that 1.4-14 fixes the entities issue.

Comment 29 Matthew Casperson 2014-02-18 06:38:18 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1066235 is the only outstanding issue, and it is related more to the validation of topics than anything to do with docbook 5, so I'm going to call this one verified.