• 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:

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.
 
Slime does not pay. Always keep your tiny ad dry.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic