---
title: "parser(_:foundElementDeclarationWithName:model:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmlparserdelegate/parser(_:foundelementdeclarationwithname:model:)"
---

# parser(_:foundElementDeclarationWithName:model:)

Sent by a parser object to its delegate when it encounters a declaration of an element with a given model.

## Declaration

```swift
optional func parser(_ parser: XMLParser, foundElementDeclarationWithName elementName: String, model: String)
```

## Parameters

- `parser`: An NSXMLParser object parsing XML.
- `elementName`: A string that is the name of an element.
- `model`: A string that specifies a model for elementName.

## See Also

### Related Documentation

- [parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)](foundation/xmlparserdelegate/parser(_:didstartelement:namespaceuri:qualifiedname:attributes:).md)

### Handling the DTD

- [parser(_:foundAttributeDeclarationWithName:forElement:type:defaultValue:)](foundation/xmlparserdelegate/parser(_:foundattributedeclarationwithname:forelement:type:defaultvalue:).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)
