• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

unescaping in xml document

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic