cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal Error: com.sap.engine.lib.xml.parser.ParserException:

former_member556603
Active Contributor
0 Kudos

Hi

Could someone please tell me how to include the & in an XML element.

<MAKTX>Paris Ygt Caramelo & Maggi 12x460g</MAKTX>

As shown above, I want to have a the name Paris Ygt Caramelo & Maggi 12x460g as XML data.

But when I check it for well-formed condition, it gives an error.

I know it's possible by using Java Mapping.

Please do needful...

Thanks

Satya

Edited by: SATYA KUMAR AKKARABOYANA on Nov 17, 2009 10:15 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

abhay_rajhans2
Contributor
0 Kudos

Hi

Find below code has to be written in a UDF where u want & as output. Between source field and target field put this code.

This will help u for & as well as #

// To convort html ascii value to character value

String theToken = "";

String newToken = "";

String out = "";

int next ;

int index1;

int index2;

int prev1;

int ascii;

String var = Field Name[flag][3].substring(4);

// To reomve ascii value

StringTokenizer st = new StringTokenizer(var,";");

while (st.hasMoreTokens())

{

theToken = st.nextToken();

// Append previous value

theToken = out + theToken;

// Find last value

next = st.countTokens();

// trace.addWarning("next: " + next);

if ( next != 0 )

{

index1 = theToken.length();

prev1 = index1 - 4;

// Remove &#value from end

newToken = theToken.substring(0,prev1);

index2 = index1 - 2;

String var2 = theToken.substring(index2,index1);

ascii = Integer.parseInt(var2);

char val = (char)ascii;

// trace.addWarning("VAL: " + val);

out = newToken + val;

}

else

{

out = theToken;

}

}

former_member181962
Active Contributor
0 Kudos
Former Member
0 Kudos

For PI 7.1 extend your class to AbstractTransform than implementing StreamTransform.

Former Member
0 Kudos

Hi

Try to replace it with

&amp;

... It's the XML entity that represents this symbol

Hope this helps

Chris

Edited by: Christophe PFERTZEL on Nov 17, 2009 10:17 AM