Community
Participate
Working Groups
The string character "<" included in a string field of a profile (ocra:contract below)is written to the UML as "<". The profile is applied to a constraint specification. This is the line from the offending UML. <ocra:contract xmi:id="_zgnVEODtEeWVnvZ8K98owA" name="addition_behavior" comment="--the output of the addition gate is the result of the addition of the two inputs" assume="true;" guarantee="always (out = 10 iff ((in_1 + in_2) >= 10)) and always (out = (in_1 + in_2) iff ((in_1 + in_2) <= 10));" refinedby="" base_Constraint="_P6_-kOCMEeWkB9rJha_4NQ"/> Here the < string should be < Strangely, > does not seem to have the same issue.
Created attachment 260937 [details] Test case SysML project This example test case illustrates the problem.
I reproduced the problem in Mars 1.1.4. Steps: - create an UML model - create a constraint - write <> in the constraintSpec => the result in UML file <specification xmi:type="uml:LiteralString" xmi:id="_fcXs4AIZEeaXgfGvyAf00A" name="constraintSpec" value="<>"/> The problem is present in papyrus core.
Why is this a problem? This is standard XML entity encoding. Every XML parser converts the < entity to a single left-angle-bracket character when reading the file.
Not the one I wrote, although it does now after discovering this.