[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: XML parse failed



Fritz,

What does the xml prolog header look like? Usually it should look like this, specifying utf-8 for the xml data stream:

<?xml version="1.0" encoding="UTF-8"?>

Also check the hex value of the German "ö" of "Röntgen". For utf-8 it should be x'c396'. If it actually is x'F6', then the actual encoding could be for example ISO-8859-1. If the parser expects utf-8, it throws an error, when it reads x'F6'.

The parser looks at the prolog header to select the proper encoding. If there is no prolog header, I strongly assume that it defaults to utf-8. So, if there is no xml prolog, look at the "Content-Type" header of the response message in your debug log, to figure out the encoding of the response message:

Here are some examples:

a) Encoding is ISO-8859-1.
Content-Type: text/xml;charset=ISO-8859-1

b) Encoding is utf-8.
Content-Type: text/xml;charset=utf-8

I am not sure about the deafult charset value of the content type header. But I assume, that it is us ascii.

But I strongly assume, that your parser expects utf-8, but gets another encoding such as ISO-8859-1.

Last but not least, here is where you should find the content type header:

recvresp(): entered
HTTP/1.1 200 OK
Date: Mon, 25 Jul 2016 16:23:16 GMT
Content-Type: text/xml;charset=ISO-8859-1
Content-Length: 2877
Connection: close

Thomas.

-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Logic IT: Karl Fritz
Gesendet: Dienstag, 25. Oktober 2016 16:25
An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Betreff: XML parse failed

Hi Scott,

 

Using your HTTPAPI, i got this error:

XML parse failed at line 1, col 311: not well-formed (invalid token)

 

I think the reason for that is this XML expression:

<street>Röntgen Str.</street>

 

I compiled the HTTPAPI with CCSID 500 (Switzerland) but as it seems, it don't like characters like "ö".

If I run my app without special characters, I've no probs.

 

How can I solve it?

 

Thanks,

Karl

 

--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------