• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to display " as " in XML

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used XStream to generate XML from Java object. Some values in the XML contain quotes(") for e.g. <name>"""Manas "" Sahu""</name>.

I set response.setContentType(application/xml) in my servlet.
While opening this XML file in IE it is displaying correctly as

<name>"""Manas "" Sahu""</name>

but if I save that file as XML and open that file in a notepad or Editplus it displays the value as

<name>"""Manas "" Sahu""</name>.

So my need is while opening in any editor it should display " in place of ". So could i be able to this please suggest.
Thanks in advance.
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi mate,

I guess the problem is with the version of the browser you used.
Because, I tried to simulate the same problem here and I was unable to do so.

I tried Unmarshalling and then Marshalling an XML with quotes. I used castor.
With castor again, I got proper results, ie, the quote was displayed as is.

Then I opened it in IE 6 and 7. Here again the quote was displayed as is.
Then I saved the file as an XML from IE, and opened it again using notepad editor.
The quote was displayed properly as is. It was not displayed as ampersand quote.
 
reply
    Bookmark Topic Watch Topic
  • New Topic