---
title: XMLParser.ErrorCode
framework: foundation
role: symbol
role_heading: Enumeration
path: foundation/xmlparser/errorcode
---

# XMLParser.ErrorCode

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

## Declaration

```swift
enum ErrorCode
```

## Topics

### Constants

- [XMLParser.ErrorCode.internalError](foundation/xmlparser/errorcode/internalerror.md)
- [XMLParser.ErrorCode.outOfMemoryError](foundation/xmlparser/errorcode/outofmemoryerror.md)
- [XMLParser.ErrorCode.documentStartError](foundation/xmlparser/errorcode/documentstarterror.md)
- [XMLParser.ErrorCode.emptyDocumentError](foundation/xmlparser/errorcode/emptydocumenterror.md)
- [XMLParser.ErrorCode.prematureDocumentEndError](foundation/xmlparser/errorcode/prematuredocumentenderror.md)
- [XMLParser.ErrorCode.invalidHexCharacterRefError](foundation/xmlparser/errorcode/invalidhexcharacterreferror.md)
- [XMLParser.ErrorCode.invalidDecimalCharacterRefError](foundation/xmlparser/errorcode/invaliddecimalcharacterreferror.md)
- [XMLParser.ErrorCode.invalidCharacterRefError](foundation/xmlparser/errorcode/invalidcharacterreferror.md)
- [XMLParser.ErrorCode.invalidCharacterError](foundation/xmlparser/errorcode/invalidcharactererror.md)
- [XMLParser.ErrorCode.characterRefAtEOFError](foundation/xmlparser/errorcode/characterrefateoferror.md)
- [XMLParser.ErrorCode.characterRefInPrologError](foundation/xmlparser/errorcode/characterrefinprologerror.md)
- [XMLParser.ErrorCode.characterRefInEpilogError](foundation/xmlparser/errorcode/characterrefinepilogerror.md)
- [XMLParser.ErrorCode.characterRefInDTDError](foundation/xmlparser/errorcode/characterrefindtderror.md)
- [XMLParser.ErrorCode.entityRefAtEOFError](foundation/xmlparser/errorcode/entityrefateoferror.md)
- [XMLParser.ErrorCode.entityRefInPrologError](foundation/xmlparser/errorcode/entityrefinprologerror.md)
- [XMLParser.ErrorCode.entityRefInEpilogError](foundation/xmlparser/errorcode/entityrefinepilogerror.md)
- [XMLParser.ErrorCode.entityRefInDTDError](foundation/xmlparser/errorcode/entityrefindtderror.md)
- [XMLParser.ErrorCode.parsedEntityRefAtEOFError](foundation/xmlparser/errorcode/parsedentityrefateoferror.md)
- [XMLParser.ErrorCode.parsedEntityRefInPrologError](foundation/xmlparser/errorcode/parsedentityrefinprologerror.md)
- [XMLParser.ErrorCode.parsedEntityRefInEpilogError](foundation/xmlparser/errorcode/parsedentityrefinepilogerror.md)
- [XMLParser.ErrorCode.parsedEntityRefInInternalSubsetError](foundation/xmlparser/errorcode/parsedentityrefininternalsubseterror.md)
- [XMLParser.ErrorCode.entityReferenceWithoutNameError](foundation/xmlparser/errorcode/entityreferencewithoutnameerror.md)
- [XMLParser.ErrorCode.entityReferenceMissingSemiError](foundation/xmlparser/errorcode/entityreferencemissingsemierror.md)
- [XMLParser.ErrorCode.parsedEntityRefNoNameError](foundation/xmlparser/errorcode/parsedentityrefnonameerror.md)
- [XMLParser.ErrorCode.parsedEntityRefMissingSemiError](foundation/xmlparser/errorcode/parsedentityrefmissingsemierror.md)
- [XMLParser.ErrorCode.undeclaredEntityError](foundation/xmlparser/errorcode/undeclaredentityerror.md)
- [XMLParser.ErrorCode.unparsedEntityError](foundation/xmlparser/errorcode/unparsedentityerror.md)
- [XMLParser.ErrorCode.entityIsExternalError](foundation/xmlparser/errorcode/entityisexternalerror.md)
- [XMLParser.ErrorCode.entityIsParameterError](foundation/xmlparser/errorcode/entityisparametererror.md)
- [XMLParser.ErrorCode.unknownEncodingError](foundation/xmlparser/errorcode/unknownencodingerror.md)
- [XMLParser.ErrorCode.encodingNotSupportedError](foundation/xmlparser/errorcode/encodingnotsupportederror.md)
- [XMLParser.ErrorCode.stringNotStartedError](foundation/xmlparser/errorcode/stringnotstartederror.md)
- [XMLParser.ErrorCode.stringNotClosedError](foundation/xmlparser/errorcode/stringnotclosederror.md)
- [XMLParser.ErrorCode.namespaceDeclarationError](foundation/xmlparser/errorcode/namespacedeclarationerror.md)
- [XMLParser.ErrorCode.entityNotStartedError](foundation/xmlparser/errorcode/entitynotstartederror.md)
- [XMLParser.ErrorCode.entityNotFinishedError](foundation/xmlparser/errorcode/entitynotfinishederror.md)
- [XMLParser.ErrorCode.lessThanSymbolInAttributeError](foundation/xmlparser/errorcode/lessthansymbolinattributeerror.md)
- [XMLParser.ErrorCode.attributeNotStartedError](foundation/xmlparser/errorcode/attributenotstartederror.md)
- [XMLParser.ErrorCode.attributeNotFinishedError](foundation/xmlparser/errorcode/attributenotfinishederror.md)
- [XMLParser.ErrorCode.attributeHasNoValueError](foundation/xmlparser/errorcode/attributehasnovalueerror.md)
- [XMLParser.ErrorCode.attributeRedefinedError](foundation/xmlparser/errorcode/attributeredefinederror.md)
- [XMLParser.ErrorCode.literalNotStartedError](foundation/xmlparser/errorcode/literalnotstartederror.md)
- [XMLParser.ErrorCode.literalNotFinishedError](foundation/xmlparser/errorcode/literalnotfinishederror.md)
- [XMLParser.ErrorCode.commentNotFinishedError](foundation/xmlparser/errorcode/commentnotfinishederror.md)
- [XMLParser.ErrorCode.processingInstructionNotStartedError](foundation/xmlparser/errorcode/processinginstructionnotstartederror.md)
- [XMLParser.ErrorCode.processingInstructionNotFinishedError](foundation/xmlparser/errorcode/processinginstructionnotfinishederror.md)
- [XMLParser.ErrorCode.notationNotStartedError](foundation/xmlparser/errorcode/notationnotstartederror.md)
- [XMLParser.ErrorCode.notationNotFinishedError](foundation/xmlparser/errorcode/notationnotfinishederror.md)
- [XMLParser.ErrorCode.attributeListNotStartedError](foundation/xmlparser/errorcode/attributelistnotstartederror.md)
- [XMLParser.ErrorCode.attributeListNotFinishedError](foundation/xmlparser/errorcode/attributelistnotfinishederror.md)
- [XMLParser.ErrorCode.mixedContentDeclNotStartedError](foundation/xmlparser/errorcode/mixedcontentdeclnotstartederror.md)
- [XMLParser.ErrorCode.mixedContentDeclNotFinishedError](foundation/xmlparser/errorcode/mixedcontentdeclnotfinishederror.md)
- [XMLParser.ErrorCode.elementContentDeclNotStartedError](foundation/xmlparser/errorcode/elementcontentdeclnotstartederror.md)
- [XMLParser.ErrorCode.elementContentDeclNotFinishedError](foundation/xmlparser/errorcode/elementcontentdeclnotfinishederror.md)
- [XMLParser.ErrorCode.xmlDeclNotStartedError](foundation/xmlparser/errorcode/xmldeclnotstartederror.md)
- [XMLParser.ErrorCode.xmlDeclNotFinishedError](foundation/xmlparser/errorcode/xmldeclnotfinishederror.md)
- [XMLParser.ErrorCode.conditionalSectionNotStartedError](foundation/xmlparser/errorcode/conditionalsectionnotstartederror.md)
- [XMLParser.ErrorCode.conditionalSectionNotFinishedError](foundation/xmlparser/errorcode/conditionalsectionnotfinishederror.md)
- [XMLParser.ErrorCode.externalSubsetNotFinishedError](foundation/xmlparser/errorcode/externalsubsetnotfinishederror.md)
- [XMLParser.ErrorCode.doctypeDeclNotFinishedError](foundation/xmlparser/errorcode/doctypedeclnotfinishederror.md)
- [XMLParser.ErrorCode.misplacedCDATAEndStringError](foundation/xmlparser/errorcode/misplacedcdataendstringerror.md)
- [XMLParser.ErrorCode.cdataNotFinishedError](foundation/xmlparser/errorcode/cdatanotfinishederror.md)
- [XMLParser.ErrorCode.misplacedXMLDeclarationError](foundation/xmlparser/errorcode/misplacedxmldeclarationerror.md)
- [XMLParser.ErrorCode.spaceRequiredError](foundation/xmlparser/errorcode/spacerequirederror.md)
- [XMLParser.ErrorCode.separatorRequiredError](foundation/xmlparser/errorcode/separatorrequirederror.md)
- [XMLParser.ErrorCode.nmtokenRequiredError](foundation/xmlparser/errorcode/nmtokenrequirederror.md)
- [XMLParser.ErrorCode.nameRequiredError](foundation/xmlparser/errorcode/namerequirederror.md)
- [XMLParser.ErrorCode.pcdataRequiredError](foundation/xmlparser/errorcode/pcdatarequirederror.md)
- [XMLParser.ErrorCode.uriRequiredError](foundation/xmlparser/errorcode/urirequirederror.md)
- [XMLParser.ErrorCode.publicIdentifierRequiredError](foundation/xmlparser/errorcode/publicidentifierrequirederror.md)
- [XMLParser.ErrorCode.ltRequiredError](foundation/xmlparser/errorcode/ltrequirederror.md)
- [XMLParser.ErrorCode.gtRequiredError](foundation/xmlparser/errorcode/gtrequirederror.md)
- [XMLParser.ErrorCode.ltSlashRequiredError](foundation/xmlparser/errorcode/ltslashrequirederror.md)
- [XMLParser.ErrorCode.equalExpectedError](foundation/xmlparser/errorcode/equalexpectederror.md)
- [XMLParser.ErrorCode.tagNameMismatchError](foundation/xmlparser/errorcode/tagnamemismatcherror.md)
- [XMLParser.ErrorCode.unfinishedTagError](foundation/xmlparser/errorcode/unfinishedtagerror.md)
- [XMLParser.ErrorCode.standaloneValueError](foundation/xmlparser/errorcode/standalonevalueerror.md)
- [XMLParser.ErrorCode.invalidEncodingNameError](foundation/xmlparser/errorcode/invalidencodingnameerror.md)
- [XMLParser.ErrorCode.commentContainsDoubleHyphenError](foundation/xmlparser/errorcode/commentcontainsdoublehyphenerror.md)
- [XMLParser.ErrorCode.invalidEncodingError](foundation/xmlparser/errorcode/invalidencodingerror.md)
- [XMLParser.ErrorCode.externalStandaloneEntityError](foundation/xmlparser/errorcode/externalstandaloneentityerror.md)
- [XMLParser.ErrorCode.invalidConditionalSectionError](foundation/xmlparser/errorcode/invalidconditionalsectionerror.md)
- [XMLParser.ErrorCode.entityValueRequiredError](foundation/xmlparser/errorcode/entityvaluerequirederror.md)
- [XMLParser.ErrorCode.notWellBalancedError](foundation/xmlparser/errorcode/notwellbalancederror.md)
- [XMLParser.ErrorCode.extraContentError](foundation/xmlparser/errorcode/extracontenterror.md)
- [XMLParser.ErrorCode.invalidCharacterInEntityError](foundation/xmlparser/errorcode/invalidcharacterinentityerror.md)
- [XMLParser.ErrorCode.parsedEntityRefInInternalError](foundation/xmlparser/errorcode/parsedentityrefininternalerror.md)
- [XMLParser.ErrorCode.entityRefLoopError](foundation/xmlparser/errorcode/entityreflooperror.md)
- [XMLParser.ErrorCode.entityBoundaryError](foundation/xmlparser/errorcode/entityboundaryerror.md)
- [XMLParser.ErrorCode.invalidURIError](foundation/xmlparser/errorcode/invalidurierror.md)
- [XMLParser.ErrorCode.uriFragmentError](foundation/xmlparser/errorcode/urifragmenterror.md)
- [XMLParser.ErrorCode.noDTDError](foundation/xmlparser/errorcode/nodtderror.md)
- [XMLParser.ErrorCode.delegateAbortedParseError](foundation/xmlparser/errorcode/delegateabortedparseerror.md)

### Initializers

- [init(rawValue:)](foundation/xmlparser/errorcode/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Constants

- [XMLParser.ExternalEntityResolvingPolicy](foundation/xmlparser/externalentityresolvingpolicy-swift.enum.md)
- [errorDomain](foundation/xmlparser/errordomain.md)
