• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Illegal XML characters

 
Bob Green
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My webservice response contains illegal xml characters like '&', '#'. I like to know if anyone knows of any Java class I can call to replace these characters with valid xml characters, pls. let me know.

TIA
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think # is an invalid XML character.

The main ones you need to translate are <, > and & in text, and " and ' in attributes.

Here's a very simple bit of Java that I use:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic