Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Handle special character in uri(some charactere like & and ' are valid for resource name but are store as is in xml)
Handle special character in uri [message #521443] Wed, 17 March 2010 15:45 Go to next message
Sebastien Leveque is currently offline Sebastien LevequeFriend
Messages: 1
Registered: March 2010
Junior Member
Hello,

I have created a resource that contains & in its name.
I have created a second resource that is link to the first on.

When this second resource is reloaded an error is thrown saying

The entity name must immediately follow the '&' in the entity reference

The uri of the first document is store as is without escaping & character.

href="My&.myelement#/"

It is a bug? if not how can I handle it.

Thanks
Re: Handle special character in uri [message #521469 is a reply to message #521443] Wed, 17 March 2010 15:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040806060100080400040203
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Sebastien,

Comments below.


Sebastien Leveque wrote:
> Hello,
>
> I have created a resource that contains & in its name.
> I have created a second resource that is link to the first on.
>
> When this second resource is reloaded an error is thrown saying
>
> The entity name must immediately follow the '&' in the entity reference
>
> The uri of the first document is store as is without escaping &
> character.
>
> href="My&.myelement#/"
>
> It is a bug? if not how can I handle it.
You'll need to use this option set to FALSE when saving.

/**
* Skip escaping special characters, such as '&' char, in URIs
during XML serialization.
* The default is <code>Boolean.TRUE</code>. To enforce escaping
special characters, set this
* option to <code>Boolean.FALSE</code>.
*/
String OPTION_SKIP_ESCAPE_URI = "SKIP_ESCAPE_URI";

>
> Thanks

--------------040806060100080400040203
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sebastien,<br>
<br>
Comments below.<br>
<br>
<br>
Sebastien Leveque wrote:
<blockquote cite="mid:hnqtec$bqg$1@build.eclipse.org" type="cite">Hello,
<br>
<br>
I have created a resource that contains &amp; in its name.
<br>
I have created a second resource that is link to the first on.
<br>
<br>
When this second resource is reloaded an error is thrown saying
<br>
<br>
The entity name must immediately follow the '&amp;' in the entity
reference
<br>
<br>
The uri of the first document is store as is without escaping &amp;
character.
<br>
<br>
href="My&amp;.myelement#/"
<br>
<br>
It is a bug? if not how can I handle it.
<br>
</blockquote>
You'll need to use this option set to FALSE when saving.<br>
<blockquote><small>  /**<br>
   * Skip escaping special characters, such as '&amp;' char, in URIs
during XML serialization.<br>
   * The default is &lt;code&gt;Boolean.TRUE&lt;/code&gt;. To enforce
escaping special characters, set this <br>
   * option to &lt;code&gt;Boolean.FALSE&lt;/code&gt;.<br>
   */<br>
  String OPTION_SKIP_ESCAPE_URI = "SKIP_ESCAPE_URI";</small><br>
</blockquote>
<blockquote cite="mid:hnqtec$bqg$1@build.eclipse.org" type="cite"><br>
Thanks
<br>
</blockquote>
</body>
</html>

--------------040806060100080400040203--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Teneo+EMF] Meet-in-the-Middle mapping
Next Topic:copy in loop
Goto Forum:
  


Current Time: Fri Apr 26 15:53:44 GMT 2024

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

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

Back to the top