cancel
Showing results for 
Search instead for 
Did you mean: 

Ampersand ('&') dumps XI Mapping. JDBC to BIW

jens_schmid4
Active Participant
0 Kudos

Hi.

I send data from a JDBC Connection to XI and map it there to BIW. In Mapping I run on a ParserException: Invalid char #0x16. Reason for the Exception is an ampersand is in the XML File.

Reading Data via JDBC, it would be a lot of effort to replace all possible read ampersands in every single item of all XML Files. Is there a better and more elegant way to catch this Exception or replace the ampersands or make ampersand a valid character?

Best regards.

Jens

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

Try replacing in message mapping if you know the fields because using java mapping for thz is not required...

Try writing an advanced user defined function Replace &amp and check even after that it fails..!

In case source XML is not formed then do the changes in adapter modules.!

jens_schmid4
Active Participant
0 Kudos

Hmm, Sravya and others.

I tried the advanced user functions, it didn't work and threw the same error. I think Java mapping then also fails. My problem with changing the adapter modules is the lack of a Developer Studio which is linked to the actual J2EE machine. Do I have the chance to put a .jar in there like in mapping? I really wonder why there is not standard solution for this, it should be quite common...

moorthy
Active Contributor
0 Kudos

Hi Jens,

Try with Java Mapping. It will work.

In the StartDocument Event of the Java Mapping, search for the special characters and replace there itself. Then do the actual mapping/genarating target structure.

Regards,

Moorthy

jens_schmid4
Active Participant
0 Kudos

I finally didn't try Java Mapping. Instead I try to get SAP Note 873938 implemented. It took me a little to find because this seems to be a JDBC Adapter Problem, not a Mapping one.

Answers (2)

Answers (2)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi ,

Like suggested by moorthy, one option would be to have a Java mapping,in which you will do a search and replace over the InputStream and construct the IutputStream.

Now, pass this output stream as the inout to your Graphical Mapping and you will be able to overcome this particular error.

So, basically your Interface Mapping will have have 2 mapping progrms. One, Java for search and replace and the other the grahical that wil take the putput of the java mapping as its input.

Regards,

Bhavesh

moorthy
Active Contributor
0 Kudos

Hi,

I don't think so, without changing in the mapping,it is possible

Just my suggestion is use Java Mapping here. In Java Mapping Read the xml document, and find the & and replace with & .

Because this error is because of the parser problem. Even you can & symbol, but while parsing it is not able to identify this..

Also try with message mapping itself with replacing the value...

Regards,

Moorthy

jens_schmid4
Active Participant
0 Kudos

Thanks Moorthy! Now I know what to do. Your answer really has been quick.

jens_schmid4
Active Participant
0 Kudos

And thanks for the others as well. i think I get it going now.