You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by botype <bo...@gmail.com> on 2009/01/22 11:32:57 UTC

Escape special character

Hello Every body,
 
I'am new to xmlbeans and i would like to ask you about it. I want to escape
some special characteres like "&gt;" and "&quot"..etc with xmlbeans but i
didn't find the solution for that and i can't use XmlOptionCharEscapeMap
because the release of xmlbeans that i'm using is 1.0.4.
Can you help me to resolve this probleme please.
 
Thanks,
 
Best regards,
-- 
View this message in context: http://www.nabble.com/Escape-special-character-tp21601586p21601586.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Escape special character

Posted by Radu Preotiuc <ra...@oracle.com>.
You have to be careful to do the escaping *after* saving the XML doc to
text, otherwise the '&' sign will get doubly-escaped.

Other than processing the output string, I can probably dig up the SVN
revision number of the change that added XmlOptionCharEscapeMap in the
2.x codeline and you can try to make the same change in the source code
for 1.0.x. But at this point, I would personally use my limited time to
work on fixes in the 2.x codeline rather than update 1.0.4 and probably
the other committers feel the same...

Radu

On Thu, 2009-01-22 at 09:30 -0500, Costello, Robert wrote:
> I seem to remember using org.apache.commons.lang.StringEscapeUtils for
> this, also have a snippet of vbscript which replaces characters with
> html entities
> 
>             val = Replace(val, "&", "&amp;")
>             val = Replace(val, "'", "&apos;")
>             val = Replace(val, "&", "&amp;")
>             val = Replace(val, """", "\""")
>             val = Replace(val, "<", "&lt;")
>             val = Replace(val, ">", "&gt;")
> 
> Robert Costello
> Lead Systems Engineer
> IMA Performance
> E3- 279A
> 847.286.0910
>  
> 
> 
> -----Original Message-----
> From: botype [mailto:botype@gmail.com] 
> Sent: Thursday, January 22, 2009 4:33 AM
> To: user@xmlbeans.apache.org
> Subject: Escape special character
> 
> 
> Hello Every body,
>  
> I'am new to xmlbeans and i would like to ask you about it. I want to
> escape
> some special characteres like "&gt;" and "&quot"..etc with xmlbeans but
> i
> didn't find the solution for that and i can't use XmlOptionCharEscapeMap
> because the release of xmlbeans that i'm using is 1.0.4.
> Can you help me to resolve this probleme please.
>  
> Thanks,
>  
> Best regards,


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Escape special character

Posted by "Costello, Robert" <rc...@searshc.com>.
I seem to remember using org.apache.commons.lang.StringEscapeUtils for
this, also have a snippet of vbscript which replaces characters with
html entities

            val = Replace(val, "&", "&amp;")
            val = Replace(val, "'", "&apos;")
            val = Replace(val, "&", "&amp;")
            val = Replace(val, """", "\""")
            val = Replace(val, "<", "&lt;")
            val = Replace(val, ">", "&gt;")

Robert Costello
Lead Systems Engineer
IMA Performance
E3- 279A
847.286.0910
 
 

-----Original Message-----
From: botype [mailto:botype@gmail.com] 
Sent: Thursday, January 22, 2009 4:33 AM
To: user@xmlbeans.apache.org
Subject: Escape special character


Hello Every body,
 
I'am new to xmlbeans and i would like to ask you about it. I want to
escape
some special characteres like "&gt;" and "&quot"..etc with xmlbeans but
i
didn't find the solution for that and i can't use XmlOptionCharEscapeMap
because the release of xmlbeans that i'm using is 1.0.4.
Can you help me to resolve this probleme please.
 
Thanks,
 
Best regards,
-- 
View this message in context:
http://www.nabble.com/Escape-special-character-tp21601586p21601586.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org