Bug 842198

Summary: [WebTrans] False validation warning on XML numeric entity reference with a leading space.
Product: [Retired] Zanata Reporter: Ding-Yi Chen <dchen>
Component: Component-UIAssignee: Alex Eng <aeng>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.7CC: sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 1.7.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.7.2-SNAPSHOT (20120809-0001) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-29 23:29:37 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:

Description Ding-Yi Chen 2012-07-23 02:48:34 UTC
Description of problem:
The webtrans gives falae warning on an XML numeric entity (&#999;) if it has a space in the front.

For example, webtrans show warning on 
"Web &#34;" but not 
"Web&#34"

Version-Release number of selected component (if applicable):
Zanata version 1.7.0-alpha-2-SNAPSHOT (20120723-0951)

How reproducible:
Alwways

Steps to Reproduce:
1. Visit a document.
2. Type "Web &#34;" in any empyy entry.
  
Actual results:
Validation Warning: XML entity [ &#34; ] is incomplete

Expected results:
No Validation Warning:

Additional info:
XML character entity reference (such as &nbsp;) does not seem to trigger the validation warning.

Comment 1 Runa Bhattacharjee 2012-07-30 12:01:40 UTC
Assigning to Zanata Dev Team for evaluation

Comment 3 Sean Flanigan 2012-07-31 02:58:55 UTC
I think this is the sort of thing we need to fix in 1.7.x.

Comment 4 Alex Eng 2012-07-31 03:10:52 UTC
Fix backported to 1.7.2.

Comment 5 Ding-Yi Chen 2012-08-06 01:52:46 UTC
Tested with 1.8.0-SNAPSHOT (20120806-0025) and 1.7.2-SNAPSHOT (20120806-0012)

The "Web &#34;" no longer gives false warning, however, they failed to give warning in following cases:

&#YKK; &#BBRR;

In other words, xml numeric entities that are neither decimal nor hexadecimal should produce warning like "invalid xml numeric entity".

http://en.wikipedia.org/wiki/Numeric_character_reference 
shows the valid format and restrictios.


Reassigned.

Comment 6 Alex Eng 2012-08-06 04:14:55 UTC
Implemented numeric xml entity validation.

See https://github.com/zanata/zanata/commit/7eb7e4793d8c1d5fefc5c5e545c5c45e2c363e74

Comment 7 Ding-Yi Chen 2012-08-09 01:33:46 UTC
VERIFIED with 1.8.0-SNAPSHOT (20120809-0024) 
and 1.7.2-SNAPSHOT (20120809-0001)