Bug 1053928 - Add Build/XML Validation support for DocBook 5
Summary: Add Build/XML Validation support for DocBook 5
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CCMS-Core
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1051919
TreeView+ depends on / blocked
 
Reported: 2014-01-16 01:57 UTC by Lee Newson
Modified: 2014-02-23 23:43 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-02-23 23:43:50 UTC
Embargoed:


Attachments (Terms of Use)
Customised docbook.rng (496.06 KB, application/xml)
2014-02-07 05:08 UTC, Lee Newson
no flags Details

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.


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