Arkadaşlar hata nerede bulamadım XMLDocument true yaptığımda XML içinde verileri görüyorum.Fakat android de butona bastığım anda
Cannot open file "/http:/ajansmanisa.com/cache/manset.xml".Not a directory.
hatasını alıyorum
procedure TForm1.Button2Click(Sender: TObject);
var
StartItemNode, ANode : IXMLNode;
begin
try
XMLDocument1.FileName:='http://ajansmanisa.com/cache/manset.xml';
XMLDocument1.Active:=True;
StartItemNode:=XMLDocument1.DocumentElement.ChildNodes.First.ChildNodes.FindNode('linkx');
ANode := StartItemNode;
repeat
Application.ProcessMessages;
Memo1.Lines.Add(ANode.ChildNodes['adi'].Text);
Memo1.Lines.Add(ANode.ChildNodes['ids'].Text);
Memo1.Lines.Add(ANode.ChildNodes['res'].Text);
Memo1.Lines.Add('');
ANode := ANode.NextSibling;
until
ANode=Nil;
finally
ShowMessage('xml Okundu');
end;
end;
TXMLDocument'in yardım dokümanında söyle birşey yazıyor:
Tip: To use TXMLDocument in OS X or Mobile applications, in the Object Inspector, set the DOMVendor property to ADOM XML v4 right after dropping this component onto the Form Designer. Otherwise, the TXMLDocument component is no longer usable for iOS/Android/OSX applications.
Siz bu değişikliği yaptınız mı?
Belki sorun bundan kaynaklıdır.
XMLDocument1.FileName:='http://ajansmanisa.com/cache/manset.xml';
yerine
XMLDocument1.FileName:='http:///ajansmanisa.com/cache/manset.xml';
ile denermisiniz
(12-04-2018, Saat: 12:02)SimaWB Adlı Kullanıcıdan Alıntı: [ -> ]TXMLDocument'in yardım dokümanında söyle birşey yazıyor:
Tip: To use TXMLDocument in OS X or Mobile applications, in the Object Inspector, set the DOMVendor property to ADOM XML v4 right after dropping this component onto the Form Designer. Otherwise, the TXMLDocument component is no longer usable for iOS/Android/OSX applications.
Siz bu değişikliği yaptınız mı? Belki sorun bundan kaynaklıdır.
Hocam
loadfromurl not enable for non-windows platforms currently
hatası verdi o ayarı yapınca
(12-04-2018, Saat: 12:02)meko Adlı Kullanıcıdan Alıntı: [ -> ]
XMLDocument1.FileName:='http://ajansmanisa.com/cache/manset.xml';
yerine
XMLDocument1.FileName:='http:///ajansmanisa.com/cache/manset.xml';
ile denermisiniz
Farketmiyor yinede teke düşürüyor
Önce dosyayı çalışma ortamına indirmeniz gerekiyor. Yada TMemoryStream içerisine almanız gerekiyor.
Konuyu bir inceleyin, faydası olacaktır.
(12-04-2018, Saat: 13:35)Cyber Adlı Kullanıcıdan Alıntı: [ -> ]Konuyu bir inceleyin, faydası olacaktır.
Konuyu inceledim.
kendime uyarladım
yine aynı hatayı verdi cannot open file ..... not a directory
procedure TForm1.MansetOku;
var
XMLDocument1: TXMLDocument;
XMLNode: IXMLNode;
begin
XMLDocument1 := TXMLDocument.Create(Application);
try
XMLDocument1.Active := false;
XMLDocument1.FileName := 'http://ajansmanisa.com/cache/manset.xml';
XMLDocument1.Active := true;
XMLNode := XMLDocument1.DocumentElement.ChildNodes.FindNode('linkx');
repeat
Memo1.Lines.Add(XMLNode.ChildNodes['adi'].Text);
Memo1.Lines.Add(XMLNode.ChildNodes['ids'].Text);
Memo1.Lines.Add(XMLNode.ChildNodes['res'].Text);
Memo1.Lines.Add('');
XMLNode := XMLNode.NextSibling;
until XMLNode = nil;
finally
XMLDocument1.Free;
end;
end;
Merhabalar,
XE7 den sonra delphi mobile kullanmadım fakat ozamanlardan aklımda kalan; windows platformu hariç TXMLDocument componentinin diğer platformlara desteğinin olmaması.
(12-04-2018, Saat: 15:31)barisatalay Adlı Kullanıcıdan Alıntı: [ -> ]Merhabalar,
XE7 den sonra delphi mobile kullanmadım fakat ozamanlardan aklımda kalan; windows platformu hariç TXMLDocument componentinin diğer platformlara desteğinin olmaması.
peki ne tavsiye edersiniz json txt vb.?
(12-04-2018, Saat: 15:31)barisatalay Adlı Kullanıcıdan Alıntı: [ -> ]Merhabalar,
XE7 den sonra delphi mobile kullanmadım fakat ozamanlardan aklımda kalan; windows platformu hariç TXMLDocument componentinin diğer platformlara desteğinin olmaması.
Aslında yukarıda yazdım, Object Inspector'dan DOMVendor özelliği değiştirilerek kullanılabiliyormuş. Fakat bu sefer de
ramazanayer'ın yazdığı gibi "loadfromurl not enable for non-windows platforms currently" imiş.
Aslında hata mesajı çok açık. O yüzden önce dosyayı lokale indirmek gerektiğini yazdım ama nedense ramazanayer bu mesajımı dikkate almadı sanırım
TIdHttp kullanarak dosyayı istediğiniz bir yere indirebileceğiniz gibi bir Stream içine de atabilirsiniz.
Ondan sonra XML işlemlerine kaldığınız yerden devam etmelisiniz.
Deneme yapmadan şöyle bir kod paylaşmak istiyorum; belki yol gösterir:
var
ms: TMemoryStream;
Http: TIdHttp;
Url: string;
begin
Url := 'http://ajansmanisa.com/cache/manset.xml';
ms := TMemoryStream.Create;
Http := := TIdHttp.Create(Nil);
try
Http.Request.Accept := 'text/xml, text/html, application/octet-stream';
Http.Request.ContentType := 'text/xml';
Http.Request.URL := Url;
Http.Request.Connection := Url;
Http.Get(Url, ms);
XML.LoadFromStream(ms);
finally
Http.Free;
ms.Free;
end;
end;