I have a question I hope will be quick. I am parsing XML returned by eBay’s API using SWXMLHash for Swift. Some of the returns get quite verbose.
such as:
xml["findCompletedItemsResponse"][“searchResults"][“item”]...[“sellerID"].element?.text
How would I go about compacting this to say:
xml[rootVar][“item”]...[“sellerID"].element?.text
is there a way to specify this in this instantiation? I have tried (which obviously did not work):
let xml = SWXMLHash.config {
config in
config.shouldProcessLazily = true
config.shouldProcessNamespaces = true
rootElementName = "findCompletedItemsResponse"
}.parse(response);