parser(_:parseErrorOccurred:)
Sent by a parser object to its delegate when it encounters a fatal error.
Declaration
optional func parser(_ parser: XMLParser, parseErrorOccurred parseError: any Error)Parameters
- parser:
A parser object.
- parseError:
An Nserror object describing the parsing error that occurred.
Discussion
When this method is invoked, parsing is stopped. For further information about the error, you can query parseError or you can send the parser a parserError message. You can also send the parser lineNumber and columnNumber messages to further isolate where the error occurred. Typically you implement this method to display information about the error to the user.
See Also
Handling XML
parserDidStartDocument(_:)parserDidEndDocument(_:)parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)parser(_:didEndElement:namespaceURI:qualifiedName:)parser(_:didStartMappingPrefix:toURI:)parser(_:didEndMappingPrefix:)parser(_:resolveExternalEntityName:systemID:)parser(_:validationErrorOccurred:)parser(_:foundCharacters:)parser(_:foundIgnorableWhitespace:)parser(_:foundProcessingInstructionWithTarget:data:)parser(_:foundComment:)parser(_:foundCDATA:)