<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>
<div class="gmail_quote">On Tue, Dec 3, 2013 at 11:10 PM, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz" target="_blank">johnkbird@paradise.net.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" bgcolor="#ffffff" text="#000000">
<div dir="ltr">
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Verdana';COLOR:#000080">
<div>Another possibility – less likely but an outside one – is that there might
be something about end of line terminators – ie windows uses CR LF, and
linux/Unix uses LF. I only raise it because if you save to a file and load
it seems OK, so there might be something getting the wrong line terminator (not
your fault even).</div>
<div> </div>
<div>(MacOS by contrast uses CR as a line terminator just to be
convenient).</div>
<div> </div>
<div>Programs like ftp convert text files automatically in transmission, other
communication protocols might not.</div>
<div> </div>
<div>Got bitten by it frequently when looking after cross platform software -
moving text data and source to and from Unix from Windows files often need to be
converted by utilities (I have one using sed). (Source would not
compile until converted)</div><span class="HOEnZb"><font color="#888888">
<div> </div>
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Verdana';COLOR:#000080">John
Bird<br>
<div style="FONT-SIZE:small;FONT-FAMILY:'Calibri';FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;TEXT-DECORATION:none;DISPLAY:inline"><b></b></div></div>
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Verdana';COLOR:#000080">
<div style="FONT-SIZE:small;FONT-FAMILY:'Calibri';FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;TEXT-DECORATION:none;DISPLAY:inline"><b>From:</b>
<a title="jsmith@deltics.co.nz" href="mailto:jsmith@deltics.co.nz" target="_blank">Jolyon
Smith</a> </div>
<div style="FONT:10pt tahoma">
<div style="BACKGROUND:#f5f5f5">
<div><b>Sent:</b> Tuesday, December 03, 2013 10:50 AM</div>
<div><b>To:</b> <a title="delphi@listserver.123.net.nz" href="mailto:delphi@listserver.123.net.nz" target="_blank">NZ Borland Developers Group - Delphi
List</a> </div>
<div><b>Subject:</b> Re: [DUG] Strange Error in Android</div></div></div>
<div> </div></div>
</font></span><div style="FONT-SIZE:small;FONT-FAMILY:'Calibri';FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;TEXT-DECORATION:none;DISPLAY:inline"><div><div class="h5"><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>
<blockquote style="BORDER-TOP:0px;BORDER-RIGHT:0px;BORDER-BOTTOM:0px;BORDER-LEFT:0px" type="cite">
<div style="MARGIN:30px 25px 10px">
<div style="BORDER-TOP:#edeef0 1px solid;PADDING-TOP:5px;DISPLAY:table;WIDTH:100%">
<div style="VERTICAL-ALIGN:middle;DISPLAY:table-cell;PADDING-RIGHT:6px"><img name="142b7f083efa17e5_compose-unknown-contact.jpg" src="cid:09936E07E8B548BFA6ADEF31274A94D5@JohnSony2" width="25" height="25"></div>
<div style="VERTICAL-ALIGN:middle;WHITE-SPACE:nowrap;DISPLAY:table-cell;WIDTH:100%"><a style="FONT-WEIGHT:bold;COLOR:#737f92!important;TEXT-DECORATION:none!important;PADDING-RIGHT:6px" href="mailto:rob@chreos.co.nz" target="_blank">Robert Martin</a></div>
<div style="VERTICAL-ALIGN:middle;WHITE-SPACE:nowrap;DISPLAY:table-cell"><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">
<div>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>
<div> </div>
<div>_______________________________________________<br>NZ Borland Developers
Group - Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>Admin:
<a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe:
send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a>
with Subject: unsubscribe</div></div>
<div style="MARGIN:30px 25px 10px">
<div style="BORDER-TOP:#edeef0 1px solid;PADDING-TOP:5px;DISPLAY:table;WIDTH:100%">
<div style="VERTICAL-ALIGN:middle;DISPLAY:table-cell;PADDING-RIGHT:6px"><img name="142b7f083efa17e5_compose-unknown-contact.jpg" src="cid:09936E07E8B548BFA6ADEF31274A94D5@JohnSony2" width="25" height="25"></div>
<div style="VERTICAL-ALIGN:middle;WHITE-SPACE:nowrap;DISPLAY:table-cell;WIDTH:100%"><a style="FONT-WEIGHT:bold;COLOR:#737f92!important;TEXT-DECORATION:none!important;PADDING-RIGHT:6px" href="mailto:jscoulter@gmail.com" target="_blank">Jeremy
Coulter</a></div>
<div style="VERTICAL-ALIGN:middle;WHITE-SPACE:nowrap;DISPLAY:table-cell"><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">
<div>
<p class="MsoNormal">Hi All.<u></u><u></u></p>
<p class="MsoNormal">I am Sending an HTTP request to a server that is returning
some XML in an Android app.<u></u><u></u></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.<u></u><u></u></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><u></u><u></u></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 !!<u></u><u></u></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.<u></u><u></u></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.<u></u><u></u></p>
<p class="MsoNormal">I have tried using String and DOMStrings, but still the
same error<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u> </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.<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u> </p>
<p class="MsoNormal"><u></u><u></u> </p>
<p class="MsoNormal">Thanks, Jeremy<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u> </p>
<p class="MsoNormal"><u></u><u></u> </p></div>
<div>_______________________________________________<br>NZ Borland Developers
Group - Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>Admin:
<a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe:
send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a>
with Subject: unsubscribe</div></div></blockquote>
</div></div><p>
</p><hr><div class="im">
_______________________________________________<br>NZ Borland Developers Group -
Delphi mailing list<br>Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>Admin:
<a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to
<a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject:
unsubscribe</div><p></p></div></div></div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>