cancel
Showing results for 
Search instead for 
Did you mean: 

Regd: Handling of special characters in XML

Former Member
0 Kudos

Hi ALL,

i am using java mapping to conevrt IDOC XML to Flat file using SAX parse and then reading the whole content into a single Filed,the output of the java mapping is the input for graphical mapping .

My problem is there may be some special characters in the input IDOC. when ever these special characters come my java mapping is not able to Parse the IDOC.

Please let me know how can handle this special characters.

Thanks,

hemanth.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you need this characters on your mapping.

You can use a replace function in java.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Hemanth,

You need to identify the especial character you are talking about. then before of any parsing, replace those characters for valid ones or maybe delete them If you do not need them, finally parse your IDOC.

I hope this helps You

Regards

Ivan

Former Member
0 Kudos

Hi All,

Thanks for your suggestion . i have replaced all the special characters using string replace.

Thanks,

Hemanth.

former_member200962
Active Contributor
0 Kudos

Check this blog on how to handle special characters in a JAVA mapping:

https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Regards,

Abhishek.

Former Member
0 Kudos

Hi ,

Java has some characters reserved which is normally used to declare the Entity Name. To handle such kind of situations, you can replace these characters with these special characters, which get substituted automatically while parsing the XML file.

Refer:

http://www.javacommerce.com/displaypage.jsp?name=saxparser3.sql&id=18232

I hope it helps.

Regards,

Anurag Gargh

Edited by: Anurag Gargh on Aug 11, 2009 3:41 PM

former_member181962
Active Contributor
0 Kudos

Hi Hemanth,

Do you need the special characters to be present in the Java mapping's output?

YOu can probably replace the special characters using java string functions.

Regards,

Ravi Kanth Talagana