<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/XMLNode/predefinedNamespace(forPrefix:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSXMLNode(cm)predefinedNamespaceForPrefix:"
  },
  "title" : "predefinedNamespace(forPrefix:)"
}
-->

# predefinedNamespace(forPrefix:)

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

```
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

An `NSXMLNode` object of kind [`XMLNode.Kind.namespace`](/documentation/Foundation/XMLNode/Kind-swift.enum/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

[`+  prefixForName:`](/documentation/Foundation/XMLNode/prefix(forName:))

Returns the prefix from the specified qualified name.

[`+  localNameForName:`](/documentation/Foundation/XMLNode/localName(forName:))

Returns the local name from the specified qualified name.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)