This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unescaping in xml document

 
shail nig
Greenhorn
Posts: 14
  • 0
  • 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
  • 0
  • 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: 2938
5
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic