Is there any way to stop XMLBeans version 2.5.0 from escaping the
ampersand?  Per system requirements, I am converting special characters as

return str.replace("&", "&").replace("\"", """).replace("'",
"&#x0027;").replace("<", "&#x003C;").replace(">", "&#x003E;");

However, xmlbeans is escaping the ampersand (&#x0022; becomes &amp;x0022;);
therefore, the character comes out as code (&amp;#x0026; instead of &) when
the XML is read by another application.

XmlOptionCharEscapeMap does not have the capability to handle the codes I
need to use.  When I specify

escapes.addMapping('&', XmlOptionCharEscapeMap.HEXADECIMAL);

the ampersand comes out as &amp; instead of &#x26;.

It's likely that someone is going to respond saying xmlbeans has to escape
the ampersand because it is a mandatory restriction of XML.  If that is a
response, then please provide some type of solution to my problem because I
have to use the codes listed above.


-- Michelle

Reply via email to