• Post Reply Bookmark Topic Watch Topic
  • New Topic

xml encoding problem.  RSS feed

 
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to embedd an xml response string as CData inside an XML tree. The main XML tree is not in my control to create or change. I just have a class object where i am just setting the content as String, where the string is my xml.

The problem is when the mail xml tree appears, the content of my xml ( RawProfile ) are not properly encoded.



You might not see the encode problem above, since this editor handles it, but i hope you got my point. I ma getting these & l t ; & g t ; signs.


I am simply doing the following



where my buildRawProfile method returns a string of my xml ..."<![CDATA[<RawProfile>"....."</RawProfile>]]>".


I also tried another aproach:




But then got this error:


The last approach, i didn't like so may be if someone could give a simple solution to this encoding problem.

Thanks.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Norman Meister wrote:Hi All,
I am trying to embedd an xml response string

Norman,

The stuff you have in your code blocks is WAY too big - please read the UseCodeTags page thoroughly -
and it makes it almost impossible to read (hopefully it's as bad for you as it is for me).

Normally, I would go through and edit it, but I really don't know where to start with your stuff.
Could you please go through and break up those enormous lines? 100 characters is about the limit.

It's for your own good, because I doubt if anyone's going to want to go through it as it stands.

Thanks.

Winston
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!