Open zoufishanmehdi opened 5 years ago
HI @zoufishanmehdi, you probably don't need XMLDecoder
for this kind of format as a more high-level PropertyListDecoder
would work. You also wouldn't need the Articles
type in your snippet, Dict
and Images
are enough to decode it like this:
import Foundation
let result = try PropertyListDecoder().decode([Dict].self, from: simpleXML)
I hope this works for you!
Hi, I'm trying to parse an XML file that has a key value structure but it doesn't look like it's supported. You can see the XML file using the link and the model can be seen below. How can I parse the file below using this library?
Link to XML file: http://mobile.public.ec2.nytimes.com.s3-website-us-east-1.amazonaws.com/candidates/content/v1/articles.plist