I'm getting a RSS feed from this URL. And I use the third-party library AEXML to parse it.
guard let data = try? Data(contentsOf: URL) else {
return
}
do {
let xmlDoc = try AEXMLDocument(xml: data)
// ...
} catch let error as NSError {
print("RSS parsing failed: \(error)")
}
Parsing the above feed fails with the following error.
Error Domain=NSXMLParserErrorDomain Code=9 "(null)" UserInfo={NSXMLParserErrorLineNumber=297, NSXMLParserErrorColumn=42, NSXMLParserErrorMessage=PCDATA invalid Char value 3
I tested the feed with an XML validator and this came up.
But I don't see any special characters there.
Either way, is there a way to escape these special/invalid characters?
This RSS feed is not mine so I cannot make any changes to the feed itself from their end. All I can do is find a way to workaround it from my end.