Bug 1051925

Summary: Update XML rendering to support Docbook 5
Product: [Community] PressGang CCMS Reporter: Matthew Casperson <mcaspers>
Component: Web-UIAssignee: Matthew Casperson <mcaspers>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: cbredesen, lnewson
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:59 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    

Description Matthew Casperson 2014-01-12 22:39:12 UTC
http://www.docbook.org/tdg5/en/html/ch01.html#introduction-whats-new lists some of the new features of Docbook 5. The current style sheets will work with Docbook 5, but the process for rendering will have to be tweaked to account for the new name spaces.

For example, a topic will not have the namespace definitions, as these will be supplied in the <book> or <article> root XML element. But without the namespaces define, some Docbook 5 elements will not render correctly e.g.: 

<section>
	<title>LS command</title>
	<para>
		<application xl:href="http://www.gnu.org/software/emacs/">Emacs</application>
	</para>
</section>

won't render as is. We need to add the name spaces so what is transformed is actually something like:

<section xmlns="http://docbook.org/ns/docbook" 
        xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
	<title>LS command</title>
	<para>
		<application xl:href="http://www.gnu.org/software/emacs/">Emacs</application>
	</para>
</section>

Comment 1 Matthew Casperson 2014-01-16 03:29:40 UTC
It looks like the standard GWT XML parser doesn't handle namespaces, so all processing done prior to rendering will have to be done with regexes and not through XML DOM manipulation.

Comment 3 Lee Newson 2014-01-29 07:16:06 UTC
Verified that basic examples work, however defining other namespaces seems to cause errors for the validation and rendering.

See https://bugzilla.redhat.com/show_bug.cgi?id=1051921#c2 for more info.

Comment 4 Lee Newson 2014-01-29 07:34:51 UTC
Adding that I've tested the additional topic types to make sure they render:

Revision History
Author Group
Legal Notice

Comment 5 Lee Newson 2014-02-06 04:24:51 UTC
Injections don't render or validate when the Topic Format is DocBook 5.0 due to the injection resolver using <ulink>s. It should now be something like:

<link xlink:href="...">Topic 10</link>

Comment 6 Lee Newson 2014-02-10 05:34:18 UTC
I've fixed up the Injection linking issue in 1.4-SNAPSHOT build 201402101456

Comment 7 Matthew Casperson 2014-02-11 21:10:08 UTC
Automatic namespace addition has been removed, so all namespaces are now manually defined in the topic.

Comment 8 Lee Newson 2014-02-11 23:09:26 UTC
Verified that rendering works as expected taking into account the issue with having to use a DTD for validation (ie no custom namespaces)

Comment 9 Lee Newson 2014-02-14 03:47:01 UTC
Moving this back to assigned as something has broken this in additional updates. Legal Notice and Author Group no longer renders.

Comment 10 Lee Newson 2014-02-14 04:50:54 UTC
Fixed in 1.4-SNAPSHOT build 201402141412

The namespaces were being applied before the <authorgroup> or <legalnotice> elements were wrapped. There was also an issue with the getRootElementName where it was returning more than it should have been.