I am trying to read a straightforward XML file, but I can't get XMLDocument() -- Use of unresolved identifier 'XMLDocument'; did you mean 'UIDocument'?, although I can get XMLParserDelegate() to initialize with the same URL. What am I missing here?
Why can my Xcode project see XMLParserDelegate but it can't see XMLDocument?
Foundation has two XML APIs:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
NSXMLDocument (XMLDocument in Swift) which is a document (tree) API
NSXMLParser (XMLParser in Swift) which is a streaming (SAX) API
You can switch to the streaming model.
If you absolutely need to use the document model, you can use the lower-level APIs in libxml2.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"