< DOMNamespaceAware > Protocol Reference

Inheritance diagram for < DOMNamespaceAware >:

< DOMAttribute > < DOMElement > DOMAttribute DOMElement List of all members.

Detailed Description

Nodes that are aware of namespaces should conform to this protocol.

Namespace-aware nodes are elements and attributes by default.


Public Member Functions

(void)  setNamespaceURI:prefix:
(NSString *)  namespaceURI
(NSString *)  namespacePrefix

Member Function Documentation

- (NSString *) namespacePrefix  
 

Returns the prefix of this node, or nil if the node has no prefix.

- (NSString *) namespaceURI  
 

Returns the namespace of this node, or nil if the node is not in a namespace.

- (void) setNamespaceURI: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

Sets the namespace of this node.

Pass nil or the empty string as URI to unset the namespace. Pass nil or the empty string as prefix to remove the prefix.

A node cannot have a prefix without having a namespace URI, it can, however, have an URI without having a prefix.

Exceptions:
DOMNamespaceException Raised if the URI is nil or the empty string and the prefix is not. Also raised if the prefix has previously been associated with another namespace URI. Also raised if the prefix is reserved (e.g attributes with prefix "xmlns" ).