Bug 1026574

Summary: Bug: Incorrect Table XML is validated as well formed
Product: [Community] PressGang CCMS Reporter: Misha H. Ali <mhusnain>
Component: Web-UIAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.2CC: lnewson, mcaspers, thildred
Target Milestone: ---   
Target Release: 1.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-03 22:16:25 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:
Bug Depends On:    
Bug Blocks: 996341    
Attachments:
Description Flags
Invalid Table Data none

Description Misha H. Ali 2013-11-05 01:27:05 UTC
Description of problem:

Topic ID 24324 contains a table that is incorrect and should break the XML. The CCMS UI seems to think it is well formed. The problem is that the table has three columns but only two are defined:

		<tgroup align="left" cols="2" colsep="1" rowsep="1">
			<colspec colname="c1"/>
			<colspec colname="c2"/>

The correct XML should look like this:

		<tgroup align="left" cols="3" colsep="1" rowsep="1">
			<colspec colname="c1"/>
			<colspec colname="c2"/>
			<colspec colname="c3"/>

The former will break if used in an offline editor and then validated by publican.

Comment 1 Misha H. Ali 2013-11-05 01:28:49 UTC
Created attachment 819442 [details]
Invalid Table Data

Attached what error appears when table XML is copied to an offline publican book and publican build is run.

Comment 2 Lee Newson 2013-11-06 06:00:01 UTC
Fixed in 1.3-SNAPSHOT build 201311061544

Example output:

topic.xml:0: element table: validity error : cols declaration doesn't match the number of entry elements

Note: Currently the line number just refers to the start of the topic instead of the actual table line number. We can get the line number but it requires extra processing, so I need to do some tests to see if the extra processing take up too many resources, since the validation needs to be as fast as possible.

Note 2: This version is currently only deployed on the test/development server.

Comment 4 Lee Newson 2013-11-07 04:41:22 UTC
Updated the validation to include the linenumber in the error output in build 201311071437.

This version is now live on the dev/test server.

Comment 5 Lee Newson 2013-11-08 03:24:16 UTC
*** Bug 995952 has been marked as a duplicate of this bug. ***

Comment 6 Matthew Casperson 2013-11-24 21:24:06 UTC
I tested various combinations of mismatched <colspec> elements, <entry> elements and @cols attribute values. The only case that breaks publican is more <entry>s than @cols, and this is now reflected in the xml validation errors.