XHR to local xml file

You must Login before you can answer or comment on any questions.

So, I've got an xml file I'd like to access and populate a table with. I can do this with XHR when calling to a server but haven't been able how to do it with a local call. Here's what I'm trying

var facFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,"xml/iphone_faculty.xml");
xhr.open("GET", Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, facFile));
Followed by the usual parsing code

2 Answers

Accepted Answer

It looks like the XML API isn't documented yet. The XML DOM example in KitchenSink might help.

XHR is meant for remote access, not local files.

Thanks for the answer. I'll be sure to get the latest Kitchen Sink example (I have 1.0).

I understand XHR being used solely for remote access as a best practice, but that is directly contradicted in Kitchen Sink by the inclusion of examples that include local HTML files and the "XHR to filesystem" example (though I've yet to really understand that example). It's all moot if, in the end, there is a way to use an XML method to parse the file and not have to go through a workaround to parse it.

Your Answer

Think you can help? Login to answer this question!