Bug 1183853 - Modeler replace a character '<' to "&lt" when user inputs charactoers to a business process id and save it
Summary: Modeler replace a character '<' to "&lt" when user inputs charactoers to a bu...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Eclipse Tooling
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Kris Verlaenen
QA Contact: Jozef Marko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-20 01:36 UTC by Hisao Furuichi
Modified: 2020-03-27 20:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:03:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Hisao Furuichi 2015-01-20 01:36:09 UTC
Description of problem:
If user inputs "<example/>" to a business process id and save it. A bpmn2 file looks like this:
==
<bpmn2:process id="&lt;example/>" tns:version="1" tns:packageName="defaultPackage" tns:adHoc="false" name="Hello World" isExecutable="true" processType="Private">
==  

Environment:
I tested with
BPMN2 Modeler 1.0.2.201402102317 with JBDS 7.1.1.GA
BPMN2 Modeler 1.1.1.201412181844 with JBDS 8.0.1.GA

Steps to Reproduce:
1. Open Modeler and create a new business process
2. For business process id, type "<example/>" and save it
3. Open saved bpmn2 file with text editor

Actual results:
A character '<' is replaced with "&lt".

Expected results:
Modeler will not replace a character '<' to "&lt".
Also Modeler will does proper input validation for id attribute.

Additional info:
I researched xml schema for a bpmn2 file, and it looks like neither '<' nor '>' are not allowed for id attribute.
http://www.w3.org/TR/xmlschema11-2/#ID
==
[Definition:]  ID represents the ID attribute type from [XML].  The ·value space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML].  The ·lexical space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ID is NCName.

pattern = \i\c* ∩ [\i-[:]][\c-[:]]*
whiteSpace = collapse

\i	the set of initial name characters, those ·matched· by NameStartChar in [XML]
\c	the set of name characters, those ·matched· by NameChar

NameStartChar	   ::=   	":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

NameChar	   ::=   	NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
http://www.w3.org/TR/xml11/#NT-NameStartChar
==

Comment 1 Robert (Bob) Brodt 2015-01-20 14:57:41 UTC
Please look at the NCName rule again; the characters <, > and / are not valid NCName characters, and the string <example/> is not a valid ID.

Comment 2 ksuzumur 2015-01-22 00:58:04 UTC
Hello Robert.

Hisao and I understand that '<','>', and '/' are not allowed for ID element. Please read "Expected Result" in Hisao's comment. Since those characters are not allowed by XML Schema, replacing '<' to "&lt" confuses user so that they might think like '<' is allowed to use.
If modeler can show some warning message in "Problems" window that user inputs an invalid character, I think that would be very user friendly.

Comment 4 Robert (Bob) Brodt 2015-01-22 02:33:47 UTC
I am already working on an enhancement to disallow invalid characters from being entered, and display an error message to that effect. That will solve this issue as well.

Comment 5 ksuzumur 2015-01-22 02:58:06 UTC
Thank for sharing the information. Is there any Bug ticket for the enhancement? If not, may I create a one for it?  With the ticket, I'm totally agree with you that the enhancement will solve this issue as well.
Thank you for your cooperation.

Comment 6 Robert (Bob) Brodt 2015-01-22 03:26:40 UTC
Yes, this is being resolved with the fix for bug 1179075.

Comment 7 Robert (Bob) Brodt 2015-01-26 20:32:38 UTC
When attempting to insert an invalid character into the ID field, an error message is displayed in the Status Bar (at bottom of Eclipse Workbench window) and the character is ignored.

Fixed in community build for Luna 1.1.1.201501262023

Comment 8 Jozef Marko 2015-02-13 09:43:30 UTC
Ignoring invalid characters verified on:
BPMN2 Modeler - 1.1.2.201502101729

Not included in:
jbds-8.0.2.GA_jbdsis-8.0.0.CR2

Comment 9 Jozef Marko 2015-04-02 11:43:24 UTC
Verified on jbds-8.1.0.CR1_jbdsis-8.0.1.CR1 - BPMN2 Modeler 1.1.2.Final


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