on 04-26-2006 9:35 AM - last edited on 02-04-2024 6:04 AM by postmig_api_4
Hi All,
I had used java mapping class in my scenario. this class parses the IDoc XML that is coming out of R/3. The IDoc XML contains a tag after 'Bef' is the root cause of the problem. the parser works fine when i remove this charecter and is failing when the charecter exists. The IDoc XML uses the encoding UTF-8. but this charecter doesn't seem to be a valid UTF-8 charecter. And i don't have a chance to modify this xml b4 parsing. I will get IDocs which contain these kind of charecters a lot. How shud i overcome this problem. any help wud b appreciated.
Thnx in Adv
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divyakumar,
Thnx for the response. The parser works fine if i use the encoding technique ISO-8859-1 instead of UTF-8. but the problem is that i'm recieving the IDoc XML from R/3 thru an input stream. and i can't c any method that can replace a string in the input stream. i tried creating a file and reading all the input from the input stram into the same file.but the problem is that while creating a file object, it is asking me the path where it shud get created? i can't give any path coz the mapping gets executed on XI server. how shud i acheive that?
Thnx in Adv
Anil
Hi Anil,
Nice to hear that change in encodeing worked.
Now before giving stream to xml parser wrtie following code
<b>BufferedInputStream stream = new BufferedInputStream();
String xmlString = new String(stream.read());
String newString = xmlString.replaceFirst("UTF-8","ISO-8859-1");
ByteArrayInputStream inputStream = new ByteArrayInputStream (newString.getBytes());
</b>
now you can use this inputStream for Parsing
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.