<html><head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">CR, LF CR+LF - all are
whitespace in XML unless in a CDATA but since the error is occurring
before the parser has even dealt with the <?xml> declaration CDATA
sections are not likely to be in play here. If the Embarcadero parser
on Android is broken by variations in whitespace I would think twice
about trusting it with anything really complicated. You know, like <span
style="font-weight: bold;">actual</span> XML. ;)<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:CAGYhmGgn7+-r0dkzEUv_MhpxugkKP0=k0UWgPfM_8eKm0KrQNQ@mail.gmail.com"
type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:jscoulter@gmail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Jeremy Coulter</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">Wed, 4 Dec 2013
10:27</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div dir="ltr">Thanks for the
replies. I was away yesterday, but I THINK John might be on the right
track. I will be checking it out and will report back.<div><br></div><div>Jeremy</div></div><div
class="gmail_extra"><br><br>
<br></div>
<div>_______________________________________________<br>NZ Borland
Developers Group - Delphi mailing list<br>Post:
<a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Admin:
<a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an
email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</div></div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px">         <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="jsmith@deltics.co.nz" photoname="Jolyon Smith"
src="cid:part1.08080208.08050306@deltics.co.nz"
name="postbox-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:jsmith@deltics.co.nz"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Jolyon Smith</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">Tue, 3 Dec 2013
10:50</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br>
Could you post the first line of the XML so we can see what it comprises
of ? i.e. what XML declaration does the string contain which the
parser is rejecting ?<br>
<br>
As a result of the DOM Vendor implementation model in Delphi, behaviour
on Windows is no indication of reliability on Android, iOS or OS X (as
you are finding).<br>
<br>
For Android it seems that the key to your problem is in
XML.Internal.AdomCore_4_3.pas, specifically the EvaluateXmlOrTextDecl()
method of TXmlInputSource but without knowing what declaration is being
presented to this method it's impossible to say whether the problem lies
here, in the process of assigning the string from the HTTP response to
the XML document or with the content of the XML string itself.<br>
<br>
There is potential for many slips twixt this particular cup and lip.<br>
<br>
</div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px">         <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="rob@chreos.co.nz" photoname="Robert Martin"
src="cid:part2.01030305.01070906@deltics.co.nz"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:rob@chreos.co.nz"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Robert Martin</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">Tue, 3 Dec 2013
09:03</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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>
<br>
<div>_______________________________________________<br>NZ Borland
Developers Group - Delphi mailing list<br>Post:
<a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Admin:
<a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an
email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</div></div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px">         <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="jscoulter@gmail.com" photoname="Jeremy Coulter"
src="cid:part2.01030305.01070906@deltics.co.nz"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
        <a moz-do-not-send="true" href="mailto:jscoulter@gmail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Jeremy Coulter</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">Mon, 2 Dec 2013
23:40</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><meta content="text/html;
charset=windows-1252" http-equiv="Content-Type"><meta content="Microsoft
Word 15 (filtered medium)" name="Generator"><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><p
class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><o:p> </o:p></p></div><div>_______________________________________________<br>NZ
Borland Developers Group - Delphi mailing list<br>Post:
<a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>Admin:
<a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an
email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</div></div>
</blockquote>
</body></html>