on 03-01-2007 3:17 PM
Hello XI gurus,
I am using Java mapping program for one interface (File-to-File) because of the complexity of mapping rules. Java mapping is throwing error whenever it encounters & (ampersand) in the file data record.
For example if the record is like this:
Adam Smith 123456789 05/06/1977 543 J & CO LTD........
the mapping program is exiting here in this record becz of '&'. error is occurring in characters method in Java SAX Parser. if i remove this char it is working fine. I tried the same data with message mapping, it is working fine.
Anybody encountered this kind of error ? Please share....
Thanks
Pavan
Pavan,
The SAX(or DOM) parser can only work on a valid XML character set. & is not a valid XML character. It has to be escaped thus in a XML file: &
Otherwise the XML file itself would not be able to be opened in a brower(or any XML reader).
So if your input XML has an unescaped '&' it is not a valid XML file.
The valid XML character set can be got at http://www.w3c.com
Thanks,
Anand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to escape characters for XML before parsing the file in your java mapping. You can use StringUtils class from Apache's commons-lang library.
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.
Hi Pavan,
Check the following blogs:
Java mapping:
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
Amaresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.