Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDOM api and dealing with XML 1.0 non-compliant chars  RSS feed

 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDOM api and dealing with XML 1.0 non-compliant chars

The setText and addContent method of org.jdom.Element throw an exception
when given an illegal char (non compliant XML 1.0 char). By illegal I don't
mean <, > (those are escapable chars not necessarily illegal).

Is there a lib out there that escapes these chars
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.util.regex package is convenient for finding and "escaping" characters in Strings that need to be XML compliant.
Bill
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!