---
title: "resolveNamespace(forName:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmlelement/resolvenamespace(forname:)"
---

# resolveNamespace(forName:)

Returns the namespace node with the prefix matching the given qualified name.

## Declaration

```swift
func resolveNamespace(forName name: String) -> XMLNode?
```

## Parameters

- `name`: A string that is the qualified name for a namespace (a qualified name is prefix plus local name).

## Return Value

Return Value An XMLNode object of kind XMLNode.Kind.namespace or nil if there is no matching namespace node.

## Discussion

Discussion The method looks in the entire namespace chain for the prefix.

## See Also

### Handling Namespaces

- [addNamespace(_:)](foundation/xmlelement/addnamespace(_:).md)
- [namespaces](foundation/xmlelement/namespaces.md)
- [namespace(forPrefix:)](foundation/xmlelement/namespace(forprefix:).md)
- [removeNamespace(forPrefix:)](foundation/xmlelement/removenamespace(forprefix:).md)
- [resolvePrefix(forNamespaceURI:)](foundation/xmlelement/resolveprefix(fornamespaceuri:).md)
