Bug 1051925 - Update XML rendering to support Docbook 5
Summary: Update XML rendering to support Docbook 5
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4
Assignee: Matthew Casperson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1051919
TreeView+ depends on / blocked
 
Reported: 2014-01-12 22:39 UTC by Matthew Casperson
Modified: 2014-08-04 22:27 UTC (History)
2 users (show)

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


Attachments (Terms of Use)

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.


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