Bug 1026574 - Bug: Incorrect Table XML is validated as well formed
Summary: Bug: Incorrect Table XML is validated as well formed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.3
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
: 995952 (view as bug list)
Depends On:
Blocks: 996341
TreeView+ depends on / blocked
 
Reported: 2013-11-05 01:27 UTC by Misha H. Ali
Modified: 2013-12-03 22:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-03 22:16:25 UTC


Attachments (Terms of Use)
Invalid Table Data (31.69 KB, image/png)
2013-11-05 01:28 UTC, Misha H. Ali
no flags Details

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.


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