---
title: XMLParserDelegate
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/xmlparserdelegate
---

# XMLParserDelegate

The interface an XML parser uses to inform its delegate about the content of the parsed document.

## Declaration

```swift
protocol XMLParserDelegate : NSObjectProtocol
```

## Topics

### Handling XML

- [parserDidStartDocument(_:)](foundation/xmlparserdelegate/parserdidstartdocument(_:).md)
- [parserDidEndDocument(_:)](foundation/xmlparserdelegate/parserdidenddocument(_:).md)
- [parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)](foundation/xmlparserdelegate/parser(_:didstartelement:namespaceuri:qualifiedname:attributes:).md)
- [parser(_:didEndElement:namespaceURI:qualifiedName:)](foundation/xmlparserdelegate/parser(_:didendelement:namespaceuri:qualifiedname:).md)
- [parser(_:didStartMappingPrefix:toURI:)](foundation/xmlparserdelegate/parser(_:didstartmappingprefix:touri:).md)
- [parser(_:didEndMappingPrefix:)](foundation/xmlparserdelegate/parser(_:didendmappingprefix:).md)
- [parser(_:resolveExternalEntityName:systemID:)](foundation/xmlparserdelegate/parser(_:resolveexternalentityname:systemid:).md)
- [parser(_:parseErrorOccurred:)](foundation/xmlparserdelegate/parser(_:parseerroroccurred:).md)
- [parser(_:validationErrorOccurred:)](foundation/xmlparserdelegate/parser(_:validationerroroccurred:).md)
- [parser(_:foundCharacters:)](foundation/xmlparserdelegate/parser(_:foundcharacters:).md)
- [parser(_:foundIgnorableWhitespace:)](foundation/xmlparserdelegate/parser(_:foundignorablewhitespace:).md)
- [parser(_:foundProcessingInstructionWithTarget:data:)](foundation/xmlparserdelegate/parser(_:foundprocessinginstructionwithtarget:data:).md)
- [parser(_:foundComment:)](foundation/xmlparserdelegate/parser(_:foundcomment:).md)
- [parser(_:foundCDATA:)](foundation/xmlparserdelegate/parser(_:foundcdata:).md)

### Handling the DTD

- [parser(_:foundAttributeDeclarationWithName:forElement:type:defaultValue:)](foundation/xmlparserdelegate/parser(_:foundattributedeclarationwithname:forelement:type:defaultvalue:).md)
- [parser(_:foundElementDeclarationWithName:model:)](foundation/xmlparserdelegate/parser(_:foundelementdeclarationwithname:model:).md)
- [parser(_:foundExternalEntityDeclarationWithName:publicID:systemID:)](foundation/xmlparserdelegate/parser(_:foundexternalentitydeclarationwithname:publicid:systemid:).md)
- [parser(_:foundInternalEntityDeclarationWithName:value:)](foundation/xmlparserdelegate/parser(_:foundinternalentitydeclarationwithname:value:).md)
- [parser(_:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:)](foundation/xmlparserdelegate/parser(_:foundunparsedentitydeclarationwithname:publicid:systemid:notationname:).md)
- [parser(_:foundNotationDeclarationWithName:publicID:systemID:)](foundation/xmlparserdelegate/parser(_:foundnotationdeclarationwithname:publicid:systemid:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Event-Based Processing

- [XMLParser](foundation/xmlparser.md)
