apache CXF - with xml string
I am using CXF for web services.
I have an inner xml wrapped by an outher xml. That is, I produce an xml:
<aa><bb><cc>bla</cc></bb></aa>
and than the CXF wraps it:
<answer><aa><bb><cc>bla</cc></bb></aa></answer>
As you can see, the <
and >
are escaped with &开发者_如何学运维;lt;
and >
.
I wish that this doesn't happen.
Thank you very much.
This behavior is by the definition of the xml syntax.
check e.g. http://en.wikipedia.org/wiki/XML
- The characters "<" and "&" are key syntax markers and may never appear in content outside of a CDATA section.
- There are five predefined entities: < represents "<", > represents ">", & represents "&", ' represents ', and " represents ".
You can try to wrap your inner xml inside a CDATA.
精彩评论