I have an application which gets it’s data (XML) from a source which I don’t have control over. That means that the source can at any time change XML tags which would render my application useless (and perhaps even crash it).
If the source changes XML tags I don’t want to change the code in the app and having to send out an updated app just because of changed XML tags. This would mean that there would be alot of users not upgrading to the new app and missing out on functionality.
So my question is basically if it’s possible to define XML tags in a URL which the app would do a lookup against each time it has to parse the XML tags.
I had a similar problem when scraping some html pages. My solution was to create a file on my server with parsing information that I could update as the site I was scraping changed. In my case it has regular expressions in the file, you could have XML tags. I download this file every time the app is launched, it is in a binary plist format and the access is reasonable fast.
I created the xml file with a plist editor, save it in binary format and FTP it to my server. I made the top element a dictionary and load it with:
I think that there is a terminal command to convert a text binary plist:
Apple used to supply “Property List Editor” as part of Xcode but they don’t any more–Bad Apple. There are other plist editors such as “PlistEdit Pro” which has a preference to save in XML, ASCII, JSON or Binary.