cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA Sax mapping replaces &_amp; with & causing mapping to fail

che_eky
Active Contributor
0 Kudos

Hi all,

I have the following mapping scenario:

Source XML -> Java Sax Mapping -> Graphical Mapping -> Target structure

The source XML is valid and caters for special characters like & which appear as &_amp; in the XML (ignore the underscore _ without it the editor strips the amp;, isn't that ironic!).

The second step of the interface mapping, which is the graphical map, is failing. It seems that the Java Sax mapping is replacing &_amp; with & in the XML, which is then causing the graphical map to fail as it cannot handle the special character &.

Is there anyway I can prevent the Java Sax mapping from changing & to &

Or is the only solution for me to write extra code in the Java map to convert & back to &_amp; before passing to the second mapping step????

Any help appreciated.

Che

Edited by: Che Eky on Feb 18, 2009 11:05 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

prasannakrishna_mynam
Contributor
0 Kudos

Hi..

Use this in your source xml file for '&' ->"&_amp;" remove the underscore

Regards..

Krishna..

Edited by: PrasannaKrishna Mynam on Feb 19, 2009 2:20 PM

Edited by: PrasannaKrishna Mynam on Feb 19, 2009 2:20 PM

prasannakrishna_mynam
Contributor
0 Kudos

Hi..

Put the escape character '\' before the &, this might work...

Regards..

Krishna..

prateek
Active Contributor
0 Kudos

This would help

https://weblogs.sdn.sap.com/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Regards,

Prateek

JoelTrinidade
Active Contributor
0 Kudos

I have still a lot more to learn from you.

che_eky
Active Contributor
0 Kudos

Hi,

Thanks for all you suggestions, I was hoping I would not have to change my Java code to get around this issue. Looks like I may have to.

If anyone has other ideas let me know.

Che

Former Member
0 Kudos

Hi

Is it possible to send XML with &_amp;amp; instead of &_amp;

worth trying, it may work

Regards

Vishnu

former_member190389
Active Contributor
0 Kudos

You will have to change the java code as in the blog pointed by prateek

JoelTrinidade
Active Contributor
0 Kudos

Hi Che,

Sorry to tell there is no other way around not that i know of . Che, since you have a graphical mapping succeeding sax mapping , the graphical mapping will not allow some special characters. Thats the way its built by SAP.

What you say is correct that you would need to take care of it by writing a code.

Rgds

joel