<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Jeremy <br>
<br>
Never done any Delphi Android work but is it possible it is a
character set issue? I am only using XE2 nut if I look at
XMLDoc.LoadFromXML() (I don't have a LoadXMLData) it takes an
AnsiString on at UTF16 delphi string.<br>
<br>
Thanks<br>
Rob<br>
<br>
<br>
On 2/12/2013 11:40 p.m., Jeremy Coulter wrote:<br>
</div>
<blockquote cite="mid:006e01ceef4a$f38dadd0$daa90970$@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi All.<o:p></o:p></p>
<p class="MsoNormal">I am Sending an HTTP request to a server
that is returning some XML in an Android app.<o:p></o:p></p>
<p class="MsoNormal">However, I get an unexpected result. I am
using Indy and the idHTTP.get() function which returns either
a string or populates a stream.<o:p></o:p></p>
<p class="MsoNormal">I started out first by loading the results
into a string variable, i.e. buffer:=isHTTP.get() which
returns the data fine, BUT if I call LoadXMLData(buffer) -
(LoadXmlData() is in Xml.XMLDoc.pas) which is a function I
have used a number of time in Delphi in normal Windows apps
and never had a problem – that wasn’t something I did <span
style="font-family:Wingdings">J</span><o:p></o:p></p>
<p class="MsoNormal">However, if in the android app, I load the
buffer variable into a string list then save that to file the
call LoadXMLDocument() that takes a file name, it works fine
!!<o:p></o:p></p>
<p class="MsoNormal">Oh, the error I get is
“ET_INVALID_XML_DECL line:-1” which indicates the XML is
invalid but if I do a showmessage(buffer) its perfectly fine.<o:p></o:p></p>
<p class="MsoNormal">I have tried loading the result into a
stream and the reading it out into a string and I get the same
error. I have tried removing the #13#10’s and STILL I get the
error. If I write the XML to file first, no problem.<o:p></o:p></p>
<p class="MsoNormal">I have tried using String and DOMStrings,
but still the same error<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Anyone got any ideas? I shouldn’t have to
write the xml to file then load it, that’s a bit of a pain.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks, Jeremy<o:p></o:p></p>
<br>
</div>
</blockquote>
<br>
</body>
</html>