Description of problem:
If user inputs "<example/>" to a business process id and save it. A bpmn2 file looks like this:
<bpmn2:process id="<example/>" tns:version="1" tns:packageName="defaultPackage" tns:adHoc="false" name="Hello World" isExecutable="true" processType="Private">
I tested with
BPMN2 Modeler 126.96.36.199402102317 with JBDS 7.1.1.GA
BPMN2 Modeler 188.8.131.52412181844 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
A character '<' is replaced with "<".
Modeler will not replace a character '<' to "<".
Also Modeler will does proper input validation for id attribute.
I researched xml schema for a bpmn2 file, and it looks like neither '<' nor '>' are not allowed for id attribute.
[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]
Please look at the NCName rule again; the characters <, > and / are not valid NCName characters, and the string <example/> is not a valid ID.
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 "<" 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.
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.
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.
Yes, this is being resolved with the fix for bug 1179075.
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 184.108.40.206501262023
Ignoring invalid characters verified on:
BPMN2 Modeler - 220.127.116.11502101729
Not included in:
Verified on jbds-8.1.0.CR1_jbdsis-8.0.1.CR1 - BPMN2 Modeler 1.1.2.Final