Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unescaping in xml document

 
shail nig
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
m using ContentHandler to generate xml
in data i have <STRONG>
which is being converted to & lt; STRONG & gt;

i want to avoid this

any idea how this can be done

Shail

[ April 12, 2006: Message edited by: shail nig ]
[ April 12, 2006: Message edited by: shail nig ]
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See that's because it is DATA. What's to prevent any system from confusing that "<STRONG>", that is data, with an actual xml tag?

The < and > get converted into entities for exactly that reason. If your xml requires the <STRONG> tag, make it part of your xml, and not your data. If not, you have to live with the conversion.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if somebody suggests that you should use a CDATA section, don't.

In particular, do not use CDATA sections as a sort of pseudo-element to hide HTML in your XML documents...

Processing XML with Java - Elliotte Rusty Harold
The CDATASection Interface
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic