namespace(withName:stringValue:)
Returns an NSXMLNode object representing a namespace with a specified name and URI.
Declaration
class func namespace(withName name: String, stringValue: String) -> AnyParameters
- name:
A string that is the name of the namespace. Specify an empty string for
nameto get the default namespace. - stringValue:
A string that identifies the URI associated with the namespace.
Return Value
An NSXMLNode object of kind XMLNode.Kind.namespace or nil if the object couldn’t be created.
Discussion
The equivalent namespace declaration in XML markup is xmlns:``name``="``value``".
Special Considerations
Applications linked on macOS 10.6 or later will throw an exception if the name parameter is nil.
See Also
Creating and Initializing Node Objects
init(kind:)init(kind:options:)document()document(withRootElement:)element(withName:)element(withName:children:attributes:)element(withName:stringValue:)element(withName:uri:)attribute(withName:stringValue:)attribute(withName:uri:stringValue:)text(withStringValue:)comment(withStringValue:)dtdNode(withXMLString:)predefinedNamespace(forPrefix:)processingInstruction(withName:stringValue:)