Protocol: NSXMLParserDelegate
Overview
The NSXMLParserDelegate protocol defines the optional methods implemented by delegates of NSXMLParser objects.Sent by a parser object to its delegate when it encounters an end tag for a specific element.Sent by a parser object to its delegate when a given namespace prefix goes out of scope.Sent by a parser object to its delegate when it encounters a start tag for a given element.Sent by a parser object to its delegate the first time it encounters a given namespace prefix, which is mapped to a URI.Sent by a parser object to its delegate when it encounters a declaration of an attribute that is associated with a specific element.Sent by a parser object to its delegate when it encounters a CDATA block.Sent by a parser object to provide its delegate with a string representing all or part of the characters of the current element.Sent by a parser object to its delegate when it encounters a comment in the XML.Sent by a parser object to its delegate when it encounters a declaration of an element with a given model.Sent by a parser object to its delegate when it encounters an external entity declaration.Reported by a parser object to provide its delegate with a string representing all or part of the ignorable whitespace characters of the current element.Sent by a parser object to the delegate when it encounters an internal entity declaration.Sent by a parser object to its delegate when it encounters a notation declaration.Sent by a parser object to its delegate when it encounters a processing instruction.Sent by a parser object to its delegate when it encounters an unparsed entity declaration.Sent by a parser object to its delegate when it encounters a fatal error.Sent by a parser object to its delegate when it encounters a given external entity with a specific system ID.Sent by a parser object to its delegate when it encounters a fatal validation error. NSXMLParser currently does not invoke this method and does not perform validation.Sent by the parser object to the delegate when it has successfully completed parsing.Sent by the parser object to the delegate when it begins parsing a document.
Instance Method Summary (collapse)
-
- parser:didEndElement:namespaceURI:qualifiedName:
Sent by a parser object to its delegate when it encounters an end tag for a specific element.
-
- parser:didEndMappingPrefix:
Sent by a parser object to its delegate when a given namespace prefix goes out of scope.
-
- parser:didStartElement:namespaceURI:qualifiedName:attributes:
Sent by a parser object to its delegate when it encounters a start tag for a given element.
-
- parser:didStartMappingPrefix:toURI:
Sent by a parser object to its delegate the first time it encounters a given namespace prefix, which is mapped to a URI.
-
- parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:
Sent by a parser object to its delegate when it encounters a declaration of an attribute that is associated with a specific element.
-
- parser:foundCDATA:
Sent by a parser object to its delegate when it encounters a CDATA block.
-
- parser:foundCharacters:
Sent by a parser object to provide its delegate with a string representing all or part of the characters of the current element.
-
- parser:foundComment:
Sent by a parser object to its delegate when it encounters a comment in the XML.
-
- parser:foundElementDeclarationWithName:model:
Sent by a parser object to its delegate when it encounters a declaration of an element with a given model.
-
- parser:foundExternalEntityDeclarationWithName:publicID:systemID:
Sent by a parser object to its delegate when it encounters an external entity declaration.
-
- parser:foundIgnorableWhitespace:
Reported by a parser object to provide its delegate with a string representing all or part of the ignorable whitespace characters of the current element.
-
- parser:foundInternalEntityDeclarationWithName:value:
Sent by a parser object to the delegate when it encounters an internal entity declaration.
-
- parser:foundNotationDeclarationWithName:publicID:systemID:
Sent by a parser object to its delegate when it encounters a notation declaration.
-
- parser:foundProcessingInstructionWithTarget:data:
Sent by a parser object to its delegate when it encounters a processing instruction.
-
- parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:
Sent by a parser object to its delegate when it encounters an unparsed entity declaration.
-
- parser:parseErrorOccurred:
Sent by a parser object to its delegate when it encounters a fatal error.
-
- parser:resolveExternalEntityName:systemID:
Sent by a parser object to its delegate when it encounters a given external entity with a specific system ID.
-
- parser:validationErrorOccurred:
Sent by a parser object to its delegate when it encounters a fatal validation error.
-
- parserDidEndDocument:
Sent by the parser object to the delegate when it has successfully completed parsing.
-
- parserDidStartDocument:
Sent by the parser object to the delegate when it begins parsing a document.
Instance Method Details
- (Object) parser(parser, didEndElement:elementName, namespaceURI:namespaceURI, qualifiedName:qName)
Sent by a parser object to its delegate when it encounters an end tag for a specific element.
- (Object) parser(parser, didEndMappingPrefix:prefix)
Sent by a parser object to its delegate when a given namespace prefix goes out of scope. The parser sends this message only when namespace-prefix reporting is turned on through the setShouldReportNamespacePrefixes: method.
- (Object) parser(parser, didStartElement:elementName, namespaceURI:namespaceURI, qualifiedName:qualifiedName, attributes:attributeDict)
Sent by a parser object to its delegate when it encounters a start tag for a given element.
- (Object) parser(parser, didStartMappingPrefix:prefix, toURI:namespaceURI)
Sent by a parser object to its delegate the first time it encounters a given namespace prefix, which is mapped to a URI. The parser object sends this message only when namespace-prefix reporting is turned on through the setShouldReportNamespacePrefixes: method.
- (Object) parser(parser, foundAttributeDeclarationWithName:attributeName, forElement:elementName, type:type, defaultValue:defaultValue)
Sent by a parser object to its delegate when it encounters a declaration of an attribute that is associated with a specific element.
- (Object) parser(parser, foundCDATA:CDATABlock)
Sent by a parser object to its delegate when it encounters a CDATA block. Through this method the parser object passes the contents of the block to its delegate in an NSData object. The CDATA block is character data that is ignored by the parser. The encoding of the character data is UTF-8. To convert the data object to a string object, use the NSString method initWithData:encoding:.
- (Object) parser(parser, foundCharacters:string)
Sent by a parser object to provide its delegate with a string representing all or part of the characters of the current element. The parser object may send the delegate several parser:foundCharacters: messages to report the characters of an element. Because string may be only part of the total character content for the current element, you should append it to the current accumulation of characters until the element changes.
- (Object) parser(parser, foundComment:comment)
Sent by a parser object to its delegate when it encounters a comment in the XML.
- (Object) parser(parser, foundElementDeclarationWithName:elementName, model:model)
Sent by a parser object to its delegate when it encounters a declaration of an element with a given model.
- (Object) parser(parser, foundExternalEntityDeclarationWithName:entityName, publicID:publicID, systemID:systemID)
Sent by a parser object to its delegate when it encounters an external entity declaration.
- (Object) parser(parser, foundIgnorableWhitespace:whitespaceString)
Reported by a parser object to provide its delegate with a string representing all or part of the ignorable whitespace characters of the current element. All the whitespace characters of the element (including carriage returns, tabs, and new-line characters) may not be provided through an individual invocation of this method. The parser may send the delegate several parser:foundIgnorableWhitespace: messages to report the whitespace characters of an element. You should append the characters in each invocation to the current accumulation of characters.
- (Object) parser(parser, foundInternalEntityDeclarationWithName:name, value:value)
Sent by a parser object to the delegate when it encounters an internal entity declaration.
- (Object) parser(parser, foundNotationDeclarationWithName:name, publicID:publicID, systemID:systemID)
Sent by a parser object to its delegate when it encounters a notation declaration.
- (Object) parser(parser, foundProcessingInstructionWithTarget:target, data:data)
Sent by a parser object to its delegate when it encounters a processing instruction.
- (Object) parser(parser, foundUnparsedEntityDeclarationWithName:name, publicID:publicID, systemID:systemID, notationName:notationName)
Sent by a parser object to its delegate when it encounters an unparsed entity declaration.
- (Object) parser(parser, parseErrorOccurred:parseError)
Sent by a parser object to its delegate when it encounters a fatal error. 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.
- (NSData) parser(parser, resolveExternalEntityName:entityName, systemID:systemID)
Sent by a parser object to its delegate when it encounters a given external entity with a specific system ID. The delegate can resolve the external entity (for example, locating and reading an externally declared DTD) and provide the result to the parser object as an NSData object.
- (Object) parser(parser, validationErrorOccurred:validError)
Sent by a parser object to its delegate when it encounters a fatal validation error. NSXMLParser currently does not invoke this method and does not perform validation. If you want to validate an XML document, use the validation features of the NSXMLDocument class.
- (Object) parserDidEndDocument(parser)
Sent by the parser object to the delegate when it has successfully completed parsing.
- (Object) parserDidStartDocument(parser)
Sent by the parser object to the delegate when it begins parsing a document.