     
     /// A parsing error, if any.
     var parsingError: NSError?
+    var parseComplete = false
     
     /// Starts parsing the feed.
     func parse() -> Result {

    {
        // Update the current path along the XML's DOM elements by deleting last component.
        self.currentXMLDOMPath = self.currentXMLDOMPath.deletingLastPathComponent()
    }
    
    func parser(_ parser: XMLParser, foundCDATA CDATABlock: Data)

    }
    
    func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {
        // Ignore errors that occur after a feed is successfully parsed. Some
        // real-world feeds contain junk such as "[]" after the XML segment;
        // just ignore this stuff.
        guard !parseComplete, parsingError == nil else { return }
        self.parsingError = NSError(domain: parseError.localizedDescription, code: -1,
            userInfo: ["CurrentPath": currentXMLDOMPath.absoluteString])
    }
    
}
