Mac Developer Library

Developer

Foundation Framework Reference NSXMLParser Class Reference

Options
Deployment Target:

On This Page
Language:

NSXMLParser

Instances of this class parse XML documents (including DTD declarations) in an event-driven manner. An NSXMLParser notifies its delegate about the items (elements, attributes, CDATA blocks, comments, and so on) that it encounters as it processes an XML document. It does not itself do anything with those parsed items except report them. It also reports parsing errors. For convenience, an NSXMLParser object in the following descriptions is sometimes referred to as a parser object. Unless used in a callback, the NSXMLParser is a thread-safe class as long as any given instance is only used in one thread. More...

Inheritance


Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.3 and later.
  • Initializes a parser with the XML content referenced by the given URL.

    Declaration

    Swift

    convenience init?(contentsOfURL url: NSURL!)

    Objective-C

    - (instancetype)initWithContentsOfURL:(NSURL *)url

    Parameters

    url

    An NSURL object specifying a URL. The URL must be fully qualified and refer to a scheme that is supported by the NSURL class.

    Return Value

    An initialized NSXMLParser object or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • Initializes a parser with the XML contents encapsulated in a given data object.

    Declaration

    Swift

    init(data data: NSData!)

    Objective-C

    - (instancetype)initWithData:(NSData *)data

    Parameters

    data

    An NSData object containing XML markup.

    Return Value

    An initialized NSXMLParser object or nil if an error occurs.

    Discussion

    This method is the designated initializer.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • Initializes a parser with the XML contents from the specified stream and parses it..

    Declaration

    Swift

    convenience init(stream stream: NSInputStream)

    Objective-C

    - (instancetype)initWithStream:(NSInputStream *)stream

    Parameters

    stream

    The input stream. The content is incrementally loaded from the specified stream and parsed. The NSXMLParser will open the stream, and synchronously read from it without scheduling it.

    Return Value

    An initialized NSXMLParser object or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • A Boolean value that determines whether the parser reports the namespaces and qualified names of elements.

    Declaration

    Swift

    var shouldProcessNamespaces: Bool

    Objective-C

    @property BOOL shouldProcessNamespaces

    Discussion

    YEStrue if the parser reports namespace and qualified name, NOfalse otherwise.

    The parser reports element names with the delegate methods parser:didStartElement:namespaceURI:qualifiedName:attributes: and parser:didEndElement:namespaceURI:qualifiedName:.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • A Boolean value that determines whether the parser reports the prefixes indicating the scope of namespace declarations.

    Declaration

    Swift

    var shouldReportNamespacePrefixes: Bool

    Objective-C

    @property BOOL shouldReportNamespacePrefixes

    Discussion

    YEStrue if the parser reports the scope of namespace declarations, NOfalse otherwise. The default value is NOfalse.

    The parser reports prefixes with the delegate methods parser:didStartMappingPrefix:toURI: and parser:didEndMappingPrefix:.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • A Boolean value that determines whether the parser reports declarations of external entities.

    Declaration

    Swift

    var shouldResolveExternalEntities: Bool

    Objective-C

    @property BOOL shouldResolveExternalEntities

    Discussion

    YEStrue if the parser reports declarations of external entities, NOfalse otherwise. The default value is NOfalse. If you set this property to YEStrue, you may cause other I/O operations, either network-based or disk-based, to load the external DTD.

    The parser reports declarations of external entities with the delegate method parser:foundExternalEntityDeclarationWithName:publicID:systemID:.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • Starts the event-driven parsing operation.

    Declaration

    Swift

    func parse() -> Bool

    Objective-C

    - (BOOL)parse

    Return Value

    YEStrue if parsing is successful and NOfalse in there is an error or if the parsing operation is aborted.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • Stops the parser object.

    Declaration

    Swift

    func abortParsing()

    Objective-C

    - (void)abortParsing

    Discussion

    If you invoke this method, the delegate, if it implements parser:parseErrorOccurred:, is informed of the cancelled parsing operation.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • An NSError object from which you can obtain information about a parsing error. (read-only)

    Declaration

    Swift

    @NSCopying var parserError: NSError? { get }

    Objective-C

    @property(readonly, copy) NSError *parserError

    Discussion

    You may access this property after a parsing operation abnormally terminates to determine the cause of error.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • The column number of the XML document being processed by the parser. (read-only)

    Declaration

    Swift

    var columnNumber: Int { get }

    Objective-C

    @property(readonly) NSInteger columnNumber

    Discussion

    The column refers to the nesting level of the XML elements in the document. You may access this property once a parsing operation has begun or after an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

    See Also

    lineNumber

  • The line number of the XML document being processed by the parser. (read-only)

    Declaration

    Swift

    var lineNumber: Int { get }

    Objective-C

    @property(readonly) NSInteger lineNumber

    Discussion

    You may access this property once a parsing operation has begun or after an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

    See Also

    columnNumber

  • publicID publicID Property

    The public identifier of the external entity referenced in the XML document. (read-only)

    Declaration

    Swift

    var publicID: String? { get }

    Objective-C

    @property(readonly, copy) NSString *publicID

    Discussion

    You may access this property once a parsing operation has begun or after an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

    See Also

    systemID

  • systemID systemID Property

    The system identifier of the external entity referenced in the XML document. (read-only)

    Declaration

    Swift

    var systemID: String? { get }

    Objective-C

    @property(readonly, copy) NSString *systemID

    Discussion

    You may access this property once a parsing operation has begun or after an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

    See Also

    publicID

Data Types

  • The following error codes are defined by NSXMLParser. For error codes not listed here, see the <libxml/xmlerror.h> header file.

    Declaration

    Swift

    enum NSXMLParserError : Int { case InternalError case OutOfMemoryError case DocumentStartError case EmptyDocumentError case PrematureDocumentEndError case InvalidHexCharacterRefError case InvalidDecimalCharacterRefError case InvalidCharacterRefError case InvalidCharacterError case CharacterRefAtEOFError case CharacterRefInPrologError case CharacterRefInEpilogError case CharacterRefInDTDError case EntityRefAtEOFError case EntityRefInPrologError case EntityRefInEpilogError case EntityRefInDTDError case ParsedEntityRefAtEOFError case ParsedEntityRefInPrologError case ParsedEntityRefInEpilogError case ParsedEntityRefInInternalSubsetError case EntityReferenceWithoutNameError case EntityReferenceMissingSemiError case ParsedEntityRefNoNameError case ParsedEntityRefMissingSemiError case UndeclaredEntityError case UnparsedEntityError case EntityIsExternalError case EntityIsParameterError case UnknownEncodingError case EncodingNotSupportedError case StringNotStartedError case StringNotClosedError case NamespaceDeclarationError case EntityNotStartedError case EntityNotFinishedError case LessThanSymbolInAttributeError case AttributeNotStartedError case AttributeNotFinishedError case AttributeHasNoValueError case AttributeRedefinedError case LiteralNotStartedError case LiteralNotFinishedError case CommentNotFinishedError case ProcessingInstructionNotStartedError case ProcessingInstructionNotFinishedError case NotationNotStartedError case NotationNotFinishedError case AttributeListNotStartedError case AttributeListNotFinishedError case MixedContentDeclNotStartedError case MixedContentDeclNotFinishedError case ElementContentDeclNotStartedError case ElementContentDeclNotFinishedError case XMLDeclNotStartedError case XMLDeclNotFinishedError case ConditionalSectionNotStartedError case ConditionalSectionNotFinishedError case ExternalSubsetNotFinishedError case DOCTYPEDeclNotFinishedError case MisplacedCDATAEndStringError case CDATANotFinishedError case MisplacedXMLDeclarationError case SpaceRequiredError case SeparatorRequiredError case NMTOKENRequiredError case NAMERequiredError case PCDATARequiredError case URIRequiredError case PublicIdentifierRequiredError case LTRequiredError case GTRequiredError case LTSlashRequiredError case EqualExpectedError case TagNameMismatchError case UnfinishedTagError case StandaloneValueError case InvalidEncodingNameError case CommentContainsDoubleHyphenError case InvalidEncodingError case ExternalStandaloneEntityError case InvalidConditionalSectionError case EntityValueRequiredError case NotWellBalancedError case ExtraContentError case InvalidCharacterInEntityError case ParsedEntityRefInInternalError case EntityRefLoopError case EntityBoundaryError case InvalidURIError case URIFragmentError case NoDTDError case DelegateAbortedParseError }

    Objective-C

    enum { NSXMLParserInternalError = 1, NSXMLParserOutOfMemoryError = 2, NSXMLParserDocumentStartError = 3, NSXMLParserEmptyDocumentError = 4, NSXMLParserPrematureDocumentEndError = 5, NSXMLParserInvalidHexCharacterRefError = 6, NSXMLParserInvalidDecimalCharacterRefError = 7, NSXMLParserInvalidCharacterRefError = 8, NSXMLParserInvalidCharacterError = 9, NSXMLParserCharacterRefAtEOFError = 10, NSXMLParserCharacterRefInPrologError = 11, NSXMLParserCharacterRefInEpilogError = 12, NSXMLParserCharacterRefInDTDError = 13, NSXMLParserEntityRefAtEOFError = 14, NSXMLParserEntityRefInPrologError = 15, NSXMLParserEntityRefInEpilogError = 16, NSXMLParserEntityRefInDTDError = 17, NSXMLParserParsedEntityRefAtEOFError = 18, NSXMLParserParsedEntityRefInPrologError = 19, NSXMLParserParsedEntityRefInEpilogError = 20, NSXMLParserParsedEntityRefInInternalSubsetError = 21, NSXMLParserEntityReferenceWithoutNameError = 22, NSXMLParserEntityReferenceMissingSemiError = 23, NSXMLParserParsedEntityRefNoNameError = 24, NSXMLParserParsedEntityRefMissingSemiError = 25, NSXMLParserUndeclaredEntityError = 26, NSXMLParserUnparsedEntityError = 28, NSXMLParserEntityIsExternalError = 29, NSXMLParserEntityIsParameterError = 30, NSXMLParserUnknownEncodingError = 31, NSXMLParserEncodingNotSupportedError = 32, NSXMLParserStringNotStartedError = 33, NSXMLParserStringNotClosedError = 34, NSXMLParserNamespaceDeclarationError = 35, NSXMLParserEntityNotStartedError = 36, NSXMLParserEntityNotFinishedError = 37, NSXMLParserLessThanSymbolInAttributeError = 38, NSXMLParserAttributeNotStartedError = 39, NSXMLParserAttributeNotFinishedError = 40, NSXMLParserAttributeHasNoValueError = 41, NSXMLParserAttributeRedefinedError = 42, NSXMLParserLiteralNotStartedError = 43, NSXMLParserLiteralNotFinishedError = 44, NSXMLParserCommentNotFinishedError = 45, NSXMLParserProcessingInstructionNotStartedError = 46, NSXMLParserProcessingInstructionNotFinishedError = 47, NSXMLParserNotationNotStartedError = 48, NSXMLParserNotationNotFinishedError = 49, NSXMLParserAttributeListNotStartedError = 50, NSXMLParserAttributeListNotFinishedError = 51, NSXMLParserMixedContentDeclNotStartedError = 52, NSXMLParserMixedContentDeclNotFinishedError = 53, NSXMLParserElementContentDeclNotStartedError = 54, NSXMLParserElementContentDeclNotFinishedError = 55, NSXMLParserXMLDeclNotStartedError = 56, NSXMLParserXMLDeclNotFinishedError = 57, NSXMLParserConditionalSectionNotStartedError = 58, NSXMLParserConditionalSectionNotFinishedError = 59, NSXMLParserExternalSubsetNotFinishedError = 60, NSXMLParserDOCTYPEDeclNotFinishedError = 61, NSXMLParserMisplacedCDATAEndStringError = 62, NSXMLParserCDATANotFinishedError = 63, NSXMLParserMisplacedXMLDeclarationError = 64, NSXMLParserSpaceRequiredError = 65, NSXMLParserSeparatorRequiredError = 66, NSXMLParserNMTOKENRequiredError = 67, NSXMLParserNAMERequiredError = 68, NSXMLParserPCDATARequiredError = 69, NSXMLParserURIRequiredError = 70, NSXMLParserPublicIdentifierRequiredError = 71, NSXMLParserLTRequiredError = 72, NSXMLParserGTRequiredError = 73, NSXMLParserLTSlashRequiredError = 74, NSXMLParserEqualExpectedError = 75, NSXMLParserTagNameMismatchError = 76, NSXMLParserUnfinishedTagError = 77, NSXMLParserStandaloneValueError = 78, NSXMLParserInvalidEncodingNameError = 79, NSXMLParserCommentContainsDoubleHyphenError = 80, NSXMLParserInvalidEncodingError = 81, NSXMLParserExternalStandaloneEntityError = 82, NSXMLParserInvalidConditionalSectionError = 83, NSXMLParserEntityValueRequiredError = 84, NSXMLParserNotWellBalancedError = 85, NSXMLParserExtraContentError = 86, NSXMLParserInvalidCharacterInEntityError = 87, NSXMLParserParsedEntityRefInInternalError = 88, NSXMLParserEntityRefLoopError = 89, NSXMLParserEntityBoundaryError = 90, NSXMLParserInvalidURIError = 91, NSXMLParserURIFragmentError = 92, NSXMLParserNoDTDError = 94, NSXMLParserDelegateAbortedParseError = 512 }; typedef NSInteger NSXMLParserError;

    Constants

    • InternalError

      NSXMLParserInternalError

      The parser object encountered an internal error.

      Available in OS X v10.3 and later.

    • OutOfMemoryError

      NSXMLParserOutOfMemoryError

      The parser object ran out of memory.

      Available in OS X v10.3 and later.

    • DocumentStartError

      NSXMLParserDocumentStartError

      The parser object is unable to start parsing.

      Available in OS X v10.3 and later.

    • EmptyDocumentError

      NSXMLParserEmptyDocumentError

      The document is empty.

      Available in OS X v10.3 and later.

    • PrematureDocumentEndError

      NSXMLParserPrematureDocumentEndError

      The document ended unexpectedly.

      Available in OS X v10.3 and later.

    • InvalidHexCharacterRefError

      NSXMLParserInvalidHexCharacterRefError

      Invalid hexadecimal character reference encountered.

      Available in OS X v10.3 and later.

    • InvalidDecimalCharacterRefError

      NSXMLParserInvalidDecimalCharacterRefError

      Invalid decimal character reference encountered.

      Available in OS X v10.3 and later.

    • InvalidCharacterRefError

      NSXMLParserInvalidCharacterRefError

      Invalid character reference encountered.

      Available in OS X v10.3 and later.

    • InvalidCharacterError

      NSXMLParserInvalidCharacterError

      Invalid character encountered.

      Available in OS X v10.3 and later.

    • CharacterRefAtEOFError

      NSXMLParserCharacterRefAtEOFError

      Target of character reference cannot be found.

      Available in OS X v10.3 and later.

    • CharacterRefInPrologError

      NSXMLParserCharacterRefInPrologError

      Invalid character found in the prolog.

      Available in OS X v10.3 and later.

    • CharacterRefInEpilogError

      NSXMLParserCharacterRefInEpilogError

      Invalid character found in the epilog.

      Available in OS X v10.3 and later.

    • CharacterRefInDTDError

      NSXMLParserCharacterRefInDTDError

      Invalid character encountered in the DTD.

      Available in OS X v10.3 and later.

    • EntityRefAtEOFError

      NSXMLParserEntityRefAtEOFError

      Target of entity reference is not found.

      Available in OS X v10.3 and later.

    • EntityRefInPrologError

      NSXMLParserEntityRefInPrologError

      Invalid entity reference found in the prolog.

      Available in OS X v10.3 and later.

    • EntityRefInEpilogError

      NSXMLParserEntityRefInEpilogError

      Invalid entity reference found in the epilog.

      Available in OS X v10.3 and later.

    • EntityRefInDTDError

      NSXMLParserEntityRefInDTDError

      Invalid entity reference found in the DTD.

      Available in OS X v10.3 and later.

    • ParsedEntityRefAtEOFError

      NSXMLParserParsedEntityRefAtEOFError

      Target of parsed entity reference is not found.

      Available in OS X v10.3 and later.

    • ParsedEntityRefInPrologError

      NSXMLParserParsedEntityRefInPrologError

      Target of parsed entity reference is not found in prolog.

      Available in OS X v10.3 and later.

    • ParsedEntityRefInEpilogError

      NSXMLParserParsedEntityRefInEpilogError

      Target of parsed entity reference is not found in epilog.

      Available in OS X v10.3 and later.

    • ParsedEntityRefInInternalSubsetError

      NSXMLParserParsedEntityRefInInternalSubsetError

      Target of parsed entity reference is not found in internal subset.

      Available in OS X v10.3 and later.

    • EntityReferenceWithoutNameError

      NSXMLParserEntityReferenceWithoutNameError

      Entity reference is without name.

      Available in OS X v10.3 and later.

    • EntityReferenceMissingSemiError

      NSXMLParserEntityReferenceMissingSemiError

      Entity reference is missing semicolon.

      Available in OS X v10.3 and later.

    • ParsedEntityRefNoNameError

      NSXMLParserParsedEntityRefNoNameError

      Parsed entity reference is without an entity name.

      Available in OS X v10.3 and later.

    • ParsedEntityRefMissingSemiError

      NSXMLParserParsedEntityRefMissingSemiError

      Parsed entity reference is missing semicolon.

      Available in OS X v10.3 and later.

    • UndeclaredEntityError

      NSXMLParserUndeclaredEntityError

      Entity is not declared.

      Available in OS X v10.3 and later.

    • UnparsedEntityError

      NSXMLParserUnparsedEntityError

      Cannot parse entity.

      Available in OS X v10.3 and later.

    • EntityIsExternalError

      NSXMLParserEntityIsExternalError

      Cannot parse external entity.

      Available in OS X v10.3 and later.

    • EntityIsParameterError

      NSXMLParserEntityIsParameterError

      Entity is a parameter.

      Available in OS X v10.3 and later.

    • UnknownEncodingError

      NSXMLParserUnknownEncodingError

      Document encoding is unknown.

      Available in OS X v10.3 and later.

    • EncodingNotSupportedError

      NSXMLParserEncodingNotSupportedError

      Document encoding is not supported.

      Available in OS X v10.3 and later.

    • StringNotStartedError

      NSXMLParserStringNotStartedError

      String is not started.

      Available in OS X v10.3 and later.

    • StringNotClosedError

      NSXMLParserStringNotClosedError

      String is not closed.

      Available in OS X v10.3 and later.

    • NamespaceDeclarationError

      NSXMLParserNamespaceDeclarationError

      Invalid namespace declaration encountered.

      Available in OS X v10.3 and later.

    • EntityNotStartedError

      NSXMLParserEntityNotStartedError

      Entity is not started.

      Available in OS X v10.3 and later.

    • EntityNotFinishedError

      NSXMLParserEntityNotFinishedError

      Entity is not finished.

      Available in OS X v10.3 and later.

    • LessThanSymbolInAttributeError

      NSXMLParserLessThanSymbolInAttributeError

      Angle bracket is used in attribute.

      Available in OS X v10.3 and later.

    • AttributeNotStartedError

      NSXMLParserAttributeNotStartedError

      Attribute is not started.

      Available in OS X v10.3 and later.

    • AttributeNotFinishedError

      NSXMLParserAttributeNotFinishedError

      Attribute is not finished.

      Available in OS X v10.3 and later.

    • AttributeHasNoValueError

      NSXMLParserAttributeHasNoValueError

      Attribute doesn’t contain a value.

      Available in OS X v10.3 and later.

    • AttributeRedefinedError

      NSXMLParserAttributeRedefinedError

      Attribute is redefined.

      Available in OS X v10.3 and later.

    • LiteralNotStartedError

      NSXMLParserLiteralNotStartedError

      Literal is not started.

      Available in OS X v10.3 and later.

    • LiteralNotFinishedError

      NSXMLParserLiteralNotFinishedError

      Literal is not finished.

      Available in OS X v10.3 and later.

    • CommentNotFinishedError

      NSXMLParserCommentNotFinishedError

      Comment is not finished.

      Available in OS X v10.3 and later.

    • ProcessingInstructionNotStartedError

      NSXMLParserProcessingInstructionNotStartedError

      Processing instruction is not started.

      Available in OS X v10.3 and later.

    • ProcessingInstructionNotFinishedError

      NSXMLParserProcessingInstructionNotFinishedError

      Processing instruction is not finished.

      Available in OS X v10.3 and later.

    • NotationNotStartedError

      NSXMLParserNotationNotStartedError

      Notation is not started.

      Available in OS X v10.3 and later.

    • NotationNotFinishedError

      NSXMLParserNotationNotFinishedError

      Notation is not finished.

      Available in OS X v10.3 and later.

    • AttributeListNotStartedError

      NSXMLParserAttributeListNotStartedError

      Attribute list is not started.

      Available in OS X v10.3 and later.

    • AttributeListNotFinishedError

      NSXMLParserAttributeListNotFinishedError

      Attribute list is not finished.

      Available in OS X v10.3 and later.

    • MixedContentDeclNotStartedError

      NSXMLParserMixedContentDeclNotStartedError

      Mixed content declaration is not started.

      Available in OS X v10.3 and later.

    • MixedContentDeclNotFinishedError

      NSXMLParserMixedContentDeclNotFinishedError

      Mixed content declaration is not finished.

      Available in OS X v10.3 and later.

    • ElementContentDeclNotStartedError

      NSXMLParserElementContentDeclNotStartedError

      Element content declaration is not started.

      Available in OS X v10.3 and later.

    • ElementContentDeclNotFinishedError

      NSXMLParserElementContentDeclNotFinishedError

      Element content declaration is not finished.

      Available in OS X v10.3 and later.

    • XMLDeclNotStartedError

      NSXMLParserXMLDeclNotStartedError

      XML declaration is not started.

      Available in OS X v10.3 and later.

    • XMLDeclNotFinishedError

      NSXMLParserXMLDeclNotFinishedError

      XML declaration is not finished.

      Available in OS X v10.3 and later.

    • ConditionalSectionNotStartedError

      NSXMLParserConditionalSectionNotStartedError

      Conditional section is not started.

      Available in OS X v10.3 and later.

    • ConditionalSectionNotFinishedError

      NSXMLParserConditionalSectionNotFinishedError

      Conditional section is not finished.

      Available in OS X v10.3 and later.

    • ExternalSubsetNotFinishedError

      NSXMLParserExternalSubsetNotFinishedError

      External subset is not finished.

      Available in OS X v10.3 and later.

    • DOCTYPEDeclNotFinishedError

      NSXMLParserDOCTYPEDeclNotFinishedError

      Document type declaration is not finished.

      Available in OS X v10.3 and later.

    • MisplacedCDATAEndStringError

      NSXMLParserMisplacedCDATAEndStringError

      Misplaced CDATA end string.

      Available in OS X v10.3 and later.

    • CDATANotFinishedError

      NSXMLParserCDATANotFinishedError

      CDATA block is not finished.

      Available in OS X v10.3 and later.

    • MisplacedXMLDeclarationError

      NSXMLParserMisplacedXMLDeclarationError

      Misplaced XML declaration.

      Available in OS X v10.3 and later.

    • SpaceRequiredError

      NSXMLParserSpaceRequiredError

      Space is required.

      Available in OS X v10.3 and later.

    • SeparatorRequiredError

      NSXMLParserSeparatorRequiredError

      Separator is required.

      Available in OS X v10.3 and later.

    • NMTOKENRequiredError

      NSXMLParserNMTOKENRequiredError

      Name token is required.

      Available in OS X v10.3 and later.

    • NAMERequiredError

      NSXMLParserNAMERequiredError

      Name is required.

      Available in OS X v10.3 and later.

    • PCDATARequiredError

      NSXMLParserPCDATARequiredError

      CDATA is required.

      Available in OS X v10.3 and later.

    • URIRequiredError

      NSXMLParserURIRequiredError

      URI is required.

      Available in OS X v10.3 and later.

    • PublicIdentifierRequiredError

      NSXMLParserPublicIdentifierRequiredError

      Public identifier is required.

      Available in OS X v10.3 and later.

    • LTRequiredError

      NSXMLParserLTRequiredError

      Left angle bracket is required.

      Available in OS X v10.3 and later.

    • GTRequiredError

      NSXMLParserGTRequiredError

      Right angle bracket is required.

      Available in OS X v10.3 and later.

    • LTSlashRequiredError

      NSXMLParserLTSlashRequiredError

      Left angle bracket slash is required.

      Available in OS X v10.3 and later.

    • EqualExpectedError

      NSXMLParserEqualExpectedError

      Equal sign expected.

      Available in OS X v10.3 and later.

    • TagNameMismatchError

      NSXMLParserTagNameMismatchError

      Tag name mismatch.

      Available in OS X v10.3 and later.

    • UnfinishedTagError

      NSXMLParserUnfinishedTagError

      Unfinished tag found.

      Available in OS X v10.3 and later.

    • StandaloneValueError

      NSXMLParserStandaloneValueError

      Standalone value found.

      Available in OS X v10.3 and later.

    • InvalidEncodingNameError

      NSXMLParserInvalidEncodingNameError

      Invalid encoding name found.

      Available in OS X v10.3 and later.

    • CommentContainsDoubleHyphenError

      NSXMLParserCommentContainsDoubleHyphenError

      Comment contains double hyphen.

      Available in OS X v10.3 and later.

    • InvalidEncodingError

      NSXMLParserInvalidEncodingError

      Invalid encoding.

      Available in OS X v10.3 and later.

    • ExternalStandaloneEntityError

      NSXMLParserExternalStandaloneEntityError

      External standalone entity.

      Available in OS X v10.3 and later.

    • InvalidConditionalSectionError

      NSXMLParserInvalidConditionalSectionError

      Invalid conditional section.

      Available in OS X v10.3 and later.

    • EntityValueRequiredError

      NSXMLParserEntityValueRequiredError

      Entity value is required.

      Available in OS X v10.3 and later.

    • NotWellBalancedError

      NSXMLParserNotWellBalancedError

      Document is not well balanced.

      Available in OS X v10.3 and later.

    • ExtraContentError

      NSXMLParserExtraContentError

      Error in content found.

      Available in OS X v10.3 and later.

    • InvalidCharacterInEntityError

      NSXMLParserInvalidCharacterInEntityError

      Invalid character in entity found.

      Available in OS X v10.3 and later.

    • ParsedEntityRefInInternalError

      NSXMLParserParsedEntityRefInInternalError

      Internal error in parsed entity reference found.

      Available in OS X v10.3 and later.

    • EntityRefLoopError

      NSXMLParserEntityRefLoopError

      Entity reference loop encountered.

      Available in OS X v10.3 and later.

    • EntityBoundaryError

      NSXMLParserEntityBoundaryError

      Entity boundary error.

      Available in OS X v10.3 and later.

    • InvalidURIError

      NSXMLParserInvalidURIError

      Invalid URI specified.

      Available in OS X v10.3 and later.

    • URIFragmentError

      NSXMLParserURIFragmentError

      URI fragment.

      Available in OS X v10.3 and later.

    • NoDTDError

      NSXMLParserNoDTDError

      Missing DTD.

      Available in OS X v10.3 and later.

    • DelegateAbortedParseError

      NSXMLParserDelegateAbortedParseError

      Delegate aborted parse.

      Available in OS X v10.3 and later.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.3 and later.

  • This constant defines the NSXMLParser error domain.

    Declaration

    Swift

    let NSXMLParserErrorDomain: NSString!

    Objective-C

    NSString * const NSXMLParserErrorDomain

    Constants

    • NSXMLParserErrorDomain

      NSXMLParserErrorDomain

      Indicates an error in XML parsing.

      Used by NSError.

      Available in OS X v10.3 and later.

    Import Statement