Skip to Content
author's profile photo Former Member
Former Member

JAVA Mapping with SAX: Illegal character exception &

Hi everybody,

I use a SAX JAVA Mapping. It throws an error cause the xml that is parsed has a

&

like in

<D_3036>Company &amp; Co. KG</D_3036>

Does anybody know how to solve the problem?

I do not want to replace the

&amp;

Are there special settings/properties for the handler/parser?

Thanks

Regards

Mario

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Dec 18, 2008 at 06:40 AM

    Make sure that the incoming message is in UTF-8 format. If not, you may place a dummy mapping before java mapping to convert the incoming message to UTF-8 encoding

    Regards,

    Prateek

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:44 AM

    Hi Mario

    special keywords in XML must be handelled by variable not directly as you have used

    follow the link to W3school for this problem.

    Plesae follow this link for an example of JAVA mapping using SAX parser

    http://objectissues.blogspot.com/2006/05/sample-sax-parser.html

    http://www.roseindia.net/xml/sax/EmployeeDetails.shtml

    regards

    sandeep

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 18, 2008 at 10:16 AM

    > I use a SAX JAVA Mapping. It throws an error cause the xml that is parsed has a

    >

    >

    &amp;

    The

    &amp;

    should not bother the mapping at all.

    What exactly is the error message which is thrown by the mapping?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 06:23 AM

    Hi all,

    thanks for your comments and suggestions. The error was not cause by the problem I describes.

    FYI:

    If there is an ampersand in the middle of a string, than the standard method

    characters

    in the handler is called three times!

    This let me asume the ampersand was the error.

    Regards Mario

    Edited by: Mario Müller on Dec 19, 2008 1:23 AM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.