cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Java Mapping

arkesh_sharma
Active Participant
0 Kudos

Hi Experts,

I am facing a serious issue in my File to File scenario. I have two step map out of which my second step map is a java map. There are fields coming in the source file which contains "&" symbols. The java map while parsing this symbol to the target does not recognize it and throws an error in PI MONI. So, to handle it I converted this symbol "&" to "&" in my java map just before mapping it to the target thinking that it will be coverted to "&" while writing it to the flat file.

The issue here is, the "&" does not get converted to "&" while writing the flat file to the target. It comes as "&" in the flat file which is not acceptable.

If I dont handle "&", the java map throws an error. If I handle it, the "&" does not get converted to "&" in the flat file.

The java version being used is 1.4.2_08

I request you to please help me in this regard and guide me how can tackle this tricky situation.

Thanks,

Arkesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Convert it to "amp;" instead of "&".

In PI everything is handles as XML, So in XML "&" is represented as amp; . Hope this helps.

Regds

RDS

Edited by: Shankar Raju Devadoss on Apr 18, 2011 12:56 AM

arkesh_sharma
Active Participant
0 Kudos

Hi RDS,

I converted "&" to "amp;" in my code but it gets passed to the target file as "amp;" which is not required.

Sorry, I did not see the query is not mentioned properly as all "amp;" got converted to "&".

I'll modify it now.

Thanks,

Arkesh

Answers (3)

Answers (3)

arkesh_sharma
Active Participant
0 Kudos

The issue with the ampersand symbol has been resolved.

I handled the ampersand at the first step map.

adarshrao23
Explorer
0 Kudos

Hi Arkesh,

Could you please elaborate the solution because I am facing the same issue. Please help!!

Regards,

Adarsh

arkesh_sharma
Active Participant
0 Kudos

Thank You Experts !

My issue has been resolved so I am closing this thread.

Thank You all for your help !

Thanks,

Arkesh

arkesh_sharma
Active Participant
0 Kudos

I have modified my query as mentioned below because all the "amp;" got converted to "&" while I posted my query so it was confusing what I was trying to say.

-


Hi Experts,

I am facing a serious issue in my File to File scenario. I have two step map out of which my second step map is a java map. There are fields coming in the source file which contains "&" symbols. The java map while parsing this symbol to the target does not recognize it and throws an error in PI MONI. So, to handle it I converted this symbol "&" to "amp;" in my java map just before mapping it to the target thinking that it will be coverted to "&" while writing it to the target flat file.

The issue here is, the "amp;" does not get converted to "&" while writing the flat file to the target. It comes as "amp;" in the flat file which is not acceptable.

If I dont handle "&", the java map throws an error. If I handle it, the "amp;" does not get converted to "&" in the flat file.

The java version being used is 1.4.2_08

I request you to please help me in this regard and guide me how can tackle this tricky situation.

Thanks,

Arkesh

Former Member
0 Kudos

Try to add one more java mapping which will convert & to "&" in the target structure.

Chk Raghu's reply for the same:

Thanks

Amit

Former Member