|
Hi Philip This is a mandatory restriction of XML. Literal ampersands have to be translated
into & in order to be valid XML unless they are part of a comment, a
processing instruction or (as Richard mentions below) a CDATA section - see http://www.w3.org/TR/REC-xml/ section
2.4. This is because & is used to mark the start of an escaped entity and
therefore cannot be used literally (like the ‘\’ character in Java
strings). As mentioned in the same document section 4.6 all XML processors _must_ recognize and translate back to the
original character data any such reference. Ultimately you sound like you are using XmlBeans
to generate XML and then send that XML (containing the & ‘s) to
something. It is that something’s responsibility to translate the
& back to & before it uses it (in your case as a URL). XmlBeans
itself will do this if it is used to receive the XML as well as to construct
it. Sorry – I know it sounds like we’re
passing the buck – but the XML spec is very specific on this. Cheers, From: Butterwood,
Richard [mailto:[EMAIL PROTECTED] How about CDATA? Richard Butterwood | Senior
Analyst/Programmer | Infor |
office: 770-418-2000 X 1167 | cell: 678-492-3080 |
fax: 770-418-2022 | [EMAIL PROTECTED] From: Monte Philip V NPRI
[mailto:[EMAIL PROTECTED] I am not sure if
this message got through the first time: I am very new to xml beans. I am trying to set the string
content of an element. I simply do
parentName.setElement("some_string"); The problem is that the string
contains ampersands (&). The string is actually a URL referring
to a Servlet. XMLBeans is replacing my &s with &. How can I prevent
this and preserve my &s?
|
Title: Message
- XML Strings with special Characters Monte Philip V NPRI
- RE: XML Strings with special Characters Butterwood, Richard
- RE: XML Strings with special Characters Lawrence Jones
- RE: XML Strings with special Characters Monte Philip V NPRI
- RE: XML Strings with special Characters Monte Philip V NPRI
- XML Strings with special Characters kathiresan jeyapandian
- RE: XML Strings with special Characters Lewis, David
- XML Strings with special Characters kathiresan jeyapandian

