book
Article ID: KB0088270
calendar_today
Updated On:
Description
Resolution:
<?tibco-char 0?> in the output represents a special character (0x00), which is the Null character. This character is invalid in XML content. BW/Designer uses XML as an internal data format. BW will use <?tibco-char 0?> to present these characters in the output panel. Other invalid characters will display the same way. Example:
0x1A => <?tibco-char 1A?>
Usually BW will not replace the character. If writing the content to file, or encoding it to base64, the correct output will be seen.
However, if there is an XML I/O process, BW will escape these characters. Ex: We will see <?tibco-char x?> in the outgoing soap messages. If using a Parse XML activity to parse an XML file which contains these characters, it will throw an Exception (invalid chars).
To resolve this issue, you will have to write Java code to replace theses characters. Sample Java code follows:
// necessary package
import sun.misc.BASE64Decoder;
..
// two methods to deal with base64
public static String toBASE64(String s) {
if (s == null)
return null;
return (new sun.misc.BASE64Encoder()).encode(s.getBytes());
}
public static String getFromBASE64(String s) {
if (s == null)
return null;
BASE64Decoder decoder = new BASE64Decoder();
try {
byte[] b = decoder.decodeBuffer(s);
return new String(b);
} catch (Exception e) {
return null;
}
}
// invoke method body
try {
inputBase64Str = getFromBASE64(inputBase64Str);
outputBase64Str = toBASE64(inputBase64Str.replace('\u0000', ' '));
} catch (Exception e) {
e.printStackTrace();
}
Issue/Introduction
Why we see ;?tibco-char 0?; in the ouput panel?