This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes unescaping in xml document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "unescaping in xml document" Watch "unescaping in xml document" New topic
Author

unescaping in xml document

shail nig
Greenhorn

Joined: Oct 20, 2003
Posts: 14
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

Joined: Jul 19, 2005
Posts: 99
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.


We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
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
 
jQuery in Action, 2nd edition
 
subject: unescaping in xml document
 
Similar Threads
SCWCD Voucher Available
Hi
SelectBooleanCheckbox dynamic id ?
passing arabic parameters
Does XSLT template declaration order matter?