OPTION_ESCAPE_USING_CDATA [message #676381] |
Fri, 03 June 2011 23:44  |
Eclipse User |
|
|
|
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 00:10  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05390 seconds