on 02-08-2008 12:49 PM
Hi,
The text file is having an '&' value (in many places). Hence the mapping is failing.
The character '&' is an illegal value in xml.
Is there a solution ?.
The client says that they cannot modify the file. We have no solution in hand.
Please help
It is very urgent.
John
Hi !
What about a search and replace script that runs in "Run Operating System Command Before"? it could receive the found filename as input parameter and could do a search and replace of all ampersands.
You could use a java proxy client to read the files, instead of a file adapter, and replace all "&" there and then hand them to the IE.
Or create your own adapter module
http://help.sap.com/saphelp_nw04/helpdata/en/96/f04142099eb76be10000000a155106/content.htm
If you use the one provided as example (converts CRLF to LF or viceversa) you have 80% of the job done.
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to write a Java Mapping that has to run before the actual mapping. The Java Mapping replaces the & with & amp;
But it has to chack, if the & is not part of an escape sequence, in that case it should not be changed.
This question is asked so often, that I would appreciate if anyone could write a blog for this.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using file type as binary in the file adapter.
Also u may use "& ;" without space instead of &
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes we know that '&' is the entity reference for '&' and that it can be used to replace it.
But........................The replacement can be done through mapping, only after the files are read by the SAX parser in XI. !!!!!!!!!
Thats exactly the problem. The parser will not read '&'.
The message is "fatal errror".
Regards,
John
Hi,
Someone has suggested that java mapping can help for the transformation of '&' to '&'.
The java mapping code will look something like:
public class FixEncoding implements StreamTransformation
{
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
String instr;
instr = parseIStreamToString(in);
instr = instr.replace( '&', '&' );
}
But even the DOM parser while reading the xml can give the same parsing error.
Hence is adapter module the only solution ?
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.