---
title: "attributeDeclaration(forName:elementName:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmldtd/attributedeclaration(forname:elementname:)"
---

# attributeDeclaration(forName:elementName:)

Returns the DTD node representing an attribute-list declaration for a given attribute and its element.

## Declaration

```swift
func attributeDeclaration(forName name: String, elementName: String) -> XMLDTDNode?
```

## Parameters

- `name`: A string object identifying the name of an attribute.
- `elementName`: A string object identifying the name of an element.

## Return Value

Return Value An autoreleased XMLDTDNode object, or nil if there is no matching attribute-list declaration.

## Discussion

Discussion For example, in the attribute-list declaration: <!ATTLIST person idnum CDATA "0000"> “idnum” would correspond to attrName and “person” would correspond to elementName.

## See Also

### Getting DTD Nodes by Name

- [predefinedEntityDeclaration(forName:)](foundation/xmldtd/predefinedentitydeclaration(forname:).md)
- [elementDeclaration(forName:)](foundation/xmldtd/elementdeclaration(forname:).md)
- [entityDeclaration(forName:)](foundation/xmldtd/entitydeclaration(forname:).md)
- [notationDeclaration(forName:)](foundation/xmldtd/notationdeclaration(forname:).md)
