• 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

Ajax response and accented characters (richfaces)

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I am using richfaces to build my application. Using the <a4j:log/> tag, I can see that the ajax responses containing accented characters (italian characters) give errors during the parsing of xml



The same request/response, using data without accented characters works fine. The document is NOT empty.

The content-type of the response is "Response with content-type: text/xml;charset=UTF-8"
I have checked using XMLSpy that the response is a well formed xml file.

Any idee how to get rid of this error?
Any help will be highly appreciated.
Thank you.

Best regards,
Felix
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I have found the problem and its solution.
The accented characters were represented by the HTML's special symbols (à, è, etc). But in XML "&" is a reference to an entity. Those entities were not defined in my xml. The solution was to prepend their definition to my xml, like this:

<!DOCTYPE newsletter [
><!ENTITY nbsp " ">
<!ENTITY lt "<">
<!ENTITY igrave "ì">
...

myxml

Best regards,
Felix
 
reply
    Bookmark Topic Watch Topic
  • New Topic