Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317176

Summary: .genmodel reload forces encoding of OCL expressions in annotations.
Product: [Modeling] EMF Reporter: Christophe Bouhier <dzonekl>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patches to address the issue none

Description Christophe Bouhier CLA 2010-06-17 10:00:11 EDT
Build Identifier: 20100218-1602

I update my model source, .xsd in this case.
In the schema, I add annotations which contain OCL expressions. (For
derived features). I then reload my .genmodel with the latest schema.
This is all fine, and I can generate the features.

I however later find out, my OCL expressions fail because the "greater
than" character has been encoded when reloading my schema.

So an expression like 'self->closure(...)' becomes 'self-&gt;closure(...)'

I presume the serializer encodes the element content in appinfo?

<xs:appinfo source="http://www.eclipse.org/OCL"
ecore:key="derive">self->closure(elements)
</xs:appinfo>


Reproducible: Always

Steps to Reproduce:
1.Add an XML Schema Annotation in any .xsd with an appinfo, add a value like in the bug description.  
2.Reload an existing .genmodel based on this schema. 
3.Check to see the ecore annotation has now an encoded the > (Greater than) char to &gt;
Comment 1 Ed Merks CLA 2010-06-17 12:51:32 EDT
Created attachment 172142 [details]
Patches to address the issue

It's kind of working as designed.  The nested content in the appinfo or documentation element could contain additional element content.  That would need to be XML parsed to be interpreted correctly and therefore other content needs to be escaped.  The patch checks for nested element content and only does this escaping in the case there is such content.
Comment 2 Ed Merks CLA 2010-09-04 13:21:21 EDT
The fix is committed to CVS for 2.7.
Comment 3 Christophe Bouhier CLA 2010-09-06 03:53:35 EDT
Thx Ed, 
I never managed to configure my workspace to pick up the patch. 
Do you know an article which described this? 

what I tried, is to import the plugin from cvs and then apply the path.
Comment 4 Ed Merks CLA 2010-09-06 11:48:27 EDT
It will be in the next integration build of 2.7.
Comment 5 Ed Merks CLA 2010-11-05 05:41:34 EDT
The fix is available in the latest build for the stream.