Hi All,
I'm using an web application where I can put HTTP post request. I have configured this part and the weird situation is that im getting a string back in stead of XML. When i send a request i give the following encoding: application/x-www-form-urlencoded; charset=UTF-8

The response is look like:

Code:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://URL">&lt;answer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;request&gt;&amp;lt;message&amp;gt;&amp;lt;authentication&amp;gt;&amp;lt;name&amp;gt;user&amp;lt;/name&amp;gt;&amp;lt;pass&amp;gt;XXXX&amp;lt;/pass&amp;gt;&amp;lt;sort&amp;gt;SB-RDW-BASIC&amp;lt;/sort&amp;gt;&amp;lt;/authentication&amp;gt;&amp;lt;parameters&amp;gt;&amp;lt;kent&amp;gt;93NRSN&amp;lt;/kent&amp;gt;&amp;lt;/parameters&amp;gt;&amp;lt;/message&amp;gt;&lt;/request&gt;&lt;result&gt;&lt;code&gt;00&lt;/code&gt;&lt;description&gt;Ok&lt;/description&gt;

.....and so on
I have put the whole reponse in a text field so i can process it. I have replaced all the weird characters by doing:

Code:
var test = "reference to the response text field";
test = test.replace(/&apos;/g, "'");
test = test.replace(/&quot;/g, '"');
test = test.replace(/&lt;/g, '<');
test = test.replace(/&amp;/g, '&');
test = test.replace(/&gt;/g, '>');
test = test.replace(/&lt;/g, '<');

return test;
In my web application there is a method to parse the XML and also a function to do xPath. But i couldt get it work, because:

- When trying to work with xPath i get: .SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
- When I open the field (after the character replaces) in the browser i see the XML starting with the following:

Code:
<?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?>\n<string xmlns=\u0022URL\u0022>

and so on...
As you can see there there is also a \u0022 character (single quotes?), i dont know how to handle these....

What is the best situation to parse the XML? Within the applicatoin there is a XMLParse function, but when i put the string (after the replaces) i couldnt get it parsed, i think the string is messed up or something? Anybody idea?