I want to parse some XML (downloaded from a URL into NSData) into an NSArray and am trying to use NSXMLDocument and NSXMLElement but can’t find the reference for them, so I’m getting unknown identifier.
Where are they? I saw XmlDocument and tried that, but can’t get to that either.
I thought there may be a sample for it since it’s got to be a common thing, but didn’t see one.
Define “can’t get to it”? I use Elements RTL’s XmlDocument for all my Xm ll needs, including in Fire, for ages. What problems are yo having, specifically?
I assume this is a Cocoa project? NSXMLDocument & co are in Foundation; XmlDocument (which I recommend to use) in in RemObjects.Elements.RTL, and needs a reference to Elements.fx (added by default, unless you unchecked the option)
That was it, thanks. I don’t seem to have had the libElements reference added, I don’t know why! It’s an app that I’ve had around for a log while. I’ve got foundation added but NSXMLDocument wasn’t showing at all.
I’ll use the XmlDocument one as you suggest, I see it looks simple to use! I assume it is something like this to get the document:
var url := RemObjects.Elements.RTL.Url.UrlWithString(‘https://myURL’);
var xmlDoc := RemObjects.Elements.RTL.XmlDocument.FromUrl(url);
I’ve actually got it working lovely from a file, so if the above doesn’t work I can download it then do it from a file.
that makes sense then. Personally, i’m so used to defaulting to use Elements RTL for everything, these days. Means less context switching between Cocoa and .NET
Curious. New app from template here finds it fine: