• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

& character messing up with the webservice's xml response

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranches,

I'm returning an OMElement on the webservice method that's called, but the problem is when it has the & ampersand char I cannot get the whole xml, seems that it stops sending the xml from that point on and just go straight to the closing tags.

Does anyone have any idea how to solve this? because sometimes I may return some other weird characters such as japanese, chinese or things like that so I just want to make sure those characters won't mess my xml up.

sample:



result:

Cheers
 
Sheriff
Posts: 27227
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not that the ampersand is a "weird" character (as you so rudely describe Japanese and Chinese), it's just that your XML document is not well-formed. You have to escape that character if you use it in a text node:
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic