on 11-17-2009 9:14 AM
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
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;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this blog:
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try to replace it with
&
... It's the XML entity that represents this symbol
Hope this helps
Chris
Edited by: Christophe PFERTZEL on Nov 17, 2009 10:17 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.