cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA Mapping with SAX: Illegal character exception &

Former Member
0 Kudos

Hi everybody,

I use a SAX JAVA Mapping. It throws an error cause the xml that is parsed has a

&

like in

<D_3036>Company &amp; Co. KG</D_3036>

Does anybody know how to solve the problem?

I do not want to replace the

&amp;

Are there special settings/properties for the handler/parser?

Thanks

Regards

Mario

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

thanks for your comments and suggestions. The error was not cause by the problem I describes.

FYI:

If there is an ampersand in the middle of a string, than the standard method

characters

in the handler is called three times!

This let me asume the ampersand was the error.

Regards Mario

Edited by: Mario Müller on Dec 19, 2008 1:23 AM

stefan_grube
Active Contributor
0 Kudos

> I use a SAX JAVA Mapping. It throws an error cause the xml that is parsed has a

>

>

&amp;

The

&amp;

should not bother the mapping at all.

What exactly is the error message which is thrown by the mapping?

Former Member
0 Kudos

Hi Mario

special keywords in XML must be handelled by variable not directly as you have used

follow the link to W3school for this problem.

Plesae follow this link for an example of JAVA mapping using SAX parser

http://objectissues.blogspot.com/2006/05/sample-sax-parser.html

http://www.roseindia.net/xml/sax/EmployeeDetails.shtml

regards

sandeep

prateek
Active Contributor
0 Kudos

Make sure that the incoming message is in UTF-8 format. If not, you may place a dummy mapping before java mapping to convert the incoming message to UTF-8 encoding

Regards,

Prateek

prasad_ulagappan2
Contributor
0 Kudos

As of my understanding, I dont think there wont be any settings/class to do that. Instead I suggest you to replace those strings to any other and in the final mapping you can very well replace the same to the original one. This will work.