---
title: "predefinedNamespace(forPrefix:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/xmlnode/predefinednamespace(forprefix:)"
---

# predefinedNamespace(forPrefix:)

Returns an NSXMLNode object representing one of the predefined namespaces with the specified prefix.

## Declaration

```swift
class func predefinedNamespace(forPrefix name: String) -> XMLNode?
```

## Parameters

- `name`: A string specifying a prefix for a predefined namespace, for example “xml”, “xs”, or “xsi”.

## Return Value

Return Value An NSXMLNode object of kind XMLNode.Kind.namespace or nil if the object couldn’t be created. If something other than a predefined-namespace prefix is specified, the method returns nil.

## See Also

### Related Documentation

- [prefix(forName:)](foundation/xmlnode/prefix(forname:).md)
- [localName(forName:)](foundation/xmlnode/localname(forname:).md)

### Creating and Initializing Node Objects

- [init(kind:)](foundation/xmlnode/init(kind:).md)
- [init(kind:options:)](foundation/xmlnode/init(kind:options:).md)
- [document()](foundation/xmlnode/document().md)
- [document(withRootElement:)](foundation/xmlnode/document(withrootelement:).md)
- [element(withName:)](foundation/xmlnode/element(withname:).md)
- [element(withName:children:attributes:)](foundation/xmlnode/element(withname:children:attributes:).md)
- [element(withName:stringValue:)](foundation/xmlnode/element(withname:stringvalue:).md)
- [element(withName:uri:)](foundation/xmlnode/element(withname:uri:).md)
- [attribute(withName:stringValue:)](foundation/xmlnode/attribute(withname:stringvalue:).md)
- [attribute(withName:uri:stringValue:)](foundation/xmlnode/attribute(withname:uri:stringvalue:).md)
- [text(withStringValue:)](foundation/xmlnode/text(withstringvalue:).md)
- [comment(withStringValue:)](foundation/xmlnode/comment(withstringvalue:).md)
- [namespace(withName:stringValue:)](foundation/xmlnode/namespace(withname:stringvalue:).md)
- [dtdNode(withXMLString:)](foundation/xmlnode/dtdnode(withxmlstring:).md)
- [processingInstruction(withName:stringValue:)](foundation/xmlnode/processinginstruction(withname:stringvalue:).md)
