Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » OPTION_ESCAPE_USING_CDATA
OPTION_ESCAPE_USING_CDATA [message #676381] Sat, 04 June 2011 03:44 Go to next message
John T.E. Timm is currently offline John T.E. TimmFriend
Messages: 160
Registered: July 2009
Senior Member
I have an Ecore model with an EAttribute named "rule" that is typed to EString. I am using the default XMI serialization which makes it an XML attribute. I want to use this feature to store XQuery which may contain XML content and special characters.

I added an EAnnotation with source set to ExtendedMetaData and kind => 'element'. Then I set default load/save options to OPTION_USE_EXTENDED_META_DATA to true. Additionally, I set save options for OPTION_ESCAPE_USING_CDATA and OPTION_SKIP_ESCAPING to true. So everything appears to be set up correctly. My expectation is that the XQuery will remain "as-is" containing unescapted '<' and '>' characters, etc. However, I am still seeing these types of special characters getting escaped.

What criteria does the deserializer use to insert <![CDATA[ ]]>?
Is there anything that I can do to ensure that what gets serialized remains "as-is"?

Thanks,

JT
Re: OPTION_ESCAPE_USING_CDATA [message #687142 is a reply to message #676381] Sat, 04 June 2011 04:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30442
Registered: July 2009
Senior Member
John,

Is it coming out as an element? You can see the option being used in
convertText; it's called by getDatatypeValue for element content...


John T.E. Timm wrote:
> I have an Ecore model with an EAttribute named "rule" that is typed to
> EString. I am using the default XMI serialization which makes it an
> XML attribute. I want to use this feature to store XQuery which may
> contain XML content and special characters.
>
> I added an EAnnotation with source set to ExtendedMetaData and kind =>
> 'element'. Then I set default load/save options to
> OPTION_USE_EXTENDED_META_DATA to true. Additionally, I set save
> options for OPTION_ESCAPE_USING_CDATA and OPTION_SKIP_ESCAPING to
> true. So everything appears to be set up correctly. My expectation is
> that the XQuery will remain "as-is" containing unescapted '<' and '>'
> characters, etc. However, I am still seeing these types of special
> characters getting escaped.
>
> What criteria does the deserializer use to insert <![CDATA[ ]]>?
> Is there anything that I can do to ensure that what gets serialized
> remains "as-is"?
>
> Thanks,
>
> JT
Previous Topic:Re: [Teneo] MySQL does not create new tables on init
Next Topic:(no subject)
Goto Forum:
  


Current Time: Mon Sep 16 15:11:18 GMT 2019

Powered by FUDForum. Page generated in 0.01899 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top