Skip to Content
avatar image
Former Member

Special Characters in a Java Mapping

Hello everybody,

in our XI we have an Interface Mapping that uses a Java Mapping, this Mapping is doing a XSD-Validation of a XML-File.

In one XML-File there is more than one special Character (ó, O², ü..). The XI-Parser hat no problems with these characters except one, eventhough this character (ó) exists more than once in the document, the parser doesn't recognize it in only one position (While Parsing the "ó" turns to a "��").

I tested the Mapping in Eclipse and it works correctly. The question is, why the special character could not be interpreted in only one position in the document.

I guess it is a bug in the XI-Parser.

I will be thankful for your help.

Best regards

Adnane

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Oct 08, 2008 at 01:59 PM

    Thanks everybody,

    I solved the Problem by implementing a XSL-Mapping bevor the Java Mapping, that converts the incomming XML to UTF-8, I don't know why the Parser doesn't use automatically UTF-8 as Standard but it works now.

    regards

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2008 at 08:58 AM

    Make sure that your Java mapping works with the same code page as the XML file.

    You can read the codepage from the XML header and work with that in your Java program.

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 09:02 AM

    Hi,

    In your java mapping if you are using <?xml version="1.0" encoding="UTF-8"?> then try with

    <?xml version="1.0" encoding="ISO-8859-1"?> if it works for you.

    Regards,

    Sarvesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 09:09 AM

    Hello,

    I replaced UTF8 through ISO8859-1 in the source XML and now all the "ó"s in the Document could not be interprted ("�"), and thats not really what i want..

    best regards

    Adnane

    Edited by: Adnane Elgoute on Oct 8, 2008 11:11 AM

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2008 at 10:37 AM

    When you mention that the ó is wrong just at one position, I wonder what the reason could be. Is this ó in a special environment, other characters around? Have you watched the XML file with a hex editor, are the hex values the same?

    Maybe you post an extract of the XML, where this ó is.

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This ó has the same Hex-code as all the others and it is in the same environment.

      I definned in the source XML in the repository test the code Page in the XML-header as follows :

      <?xml version="1.0" encoding="UTF-8"?> and that works. But when I test the Process at the runtime the problem above occurs.

      I think that the interface Mapping is getting a source XML without a header, which defines the encoding as UTF-8, because when i test the Mapping in the repository with the XML-file without the Header information, the problem with the ó occurs.

      My question is, where can i define the Encoding of the source-XML of this Interface Mapping?

      regards

  • avatar image
    Former Member
    Oct 08, 2008 at 12:02 PM

    Hello,

    The Message that is the Source XML at the Runtime begins with:

    <?xml version="1.0"?>

    When I test in the Repository with this Message, the Mapping is working correctly and all the special characters are recognised, at the runtime the Mapping doesnt recognise one "ó",

    Any Idea?

    Best regards

    Add comment
    10|10000 characters needed characters exceeded

    • The question is: how comes this message into XI? Which adapter?

      When the XML header does not state a codepage, then it has to be assigned in the content-type of the MIME header.

      In the SXMB_MONI you should be able to see the content-type of the message.

      Under Payload you see "MainDocument" and the content-type in brackets.

      Regards

      Stefan