< DOMElement > Protocol Reference

Inheritance diagram for < DOMElement >:

< DOMParent > < DOMNode > < DOMNamespaceAware > DOMElement List of all members.

Detailed Description

Represents an element node in a document.

Most methods are defined in DOMParent.


Public Member Functions

(NSString *)  name
(NSString *)  localName
(void)  setName:
(void)  setAttributeNamed:value:
(void)  setAttributeNamed:value:inNamespace:prefix:
(void)  setIdAttributeNamed:
(void)  setIdAttributeNamed:inNamespace:prefix:
(id< DOMAttribute >)  attributeNamed:
(id< DOMAttribute >)  attributeNamed:inNamespace:prefix:
(NSString *)  valueOfAttributeNamed:
(NSString *)  valueOfAttributeNamed:inNamespace:prefix:
(void)  removeAttributeNamed:
(void)  removeAttributeNamed:inNamespace:prefix:
(NSDictionary *)  attributes
(BOOL)  hasAttributeNamed:
(BOOL)  hasAttributeNamed:inNamespace:prefix:

Member Function Documentation

- (id <DOMAttribute>) attributeNamed: (NSString *)  name  
 

Returns the attribute with the specified name.

- (id <DOMAttribute>) attributeNamed: (NSString *)  localName
inNamespace: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

Returns the attribute with the specified name, in the specified namespace.

Exceptions:
NSInvalidArgumentException If namespace URI is nil or empty, and the prefix is not nil or empty

- (NSDictionary *) attributes  
 

Returns a dictionary of all attributes of this element with the qualified name of the attribute as key.

- (BOOL) hasAttributeNamed: (NSString *)  name  
 

Returns YES if this element has an attribute with the specified name.

- (BOOL) hasAttributeNamed: (NSString *)  aLocalName
inNamespace: (NSString *)  nsURI
prefix: (NSString *)  aPrefix
 
 

Returns YES if this element has an attribute with the specified name in the specified namespace.

- (NSString *) localName  
 

Returns the local name of the element.

- (NSString *) name  
 

The qualified name of this node.

The qualified name is the namespace prefix (if any) a colon and the local name (iconara:book for example).

- (void) removeAttributeNamed: (NSString *)  name  
 

Removes an attribute by it's name.

- (void) removeAttributeNamed: (NSString *)  localName
inNamespace: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

Remove an attribute by name and namespace.

- (void) setAttributeNamed: (NSString *)  name
value: (NSString *)  value
 
 

Adds a new attribute to the list of attributes.

- (void) setAttributeNamed: (NSString *)  localName
value: (NSString *)  value
inNamespace: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

Adds a new attribute to the list of attributes, the attribute is placed in the specified namespace. Pass nil or the empty string as URI for no namespace.

If the attribute is placed in a namespace, it must have a prefix.

If there is a prefix, there must be a valid namespace URI.

Exceptions:
NSInvalidArgumentException If namespace URI is nil or empty, and the prefix is not nil or empty
DOMNamespaceException Raised if there is a namespace URI, but no prefix or if the name contains a prefix, but the namespace URI is invalid

- (void) setIdAttributeNamed: (NSString *)  name  
 

Mark the attribute named as a user defined ID attribute.

Exceptions:
DOMNotFoundException Raises a DOMNotFoundException if the named attribute is not a child of this element

- (void) setIdAttributeNamed: (NSString *)  localName
inNamespace: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

Mark the attribute named as a user defined ID attribute. Works exactly as setIdAttributeNamed:, but looks only for attributes in the specified namespace.

Exceptions:
DOMNotFoundException Raises a DOMNotFoundException if the named attribute is not a child of this element

- (void) setName: (NSString *)  name  
 

Sets the name of this element.

If the name includes a namespace prefix, that prefix is looked up and set as the namespace of this element, discarding any previous namespace.

- (NSString *) valueOfAttributeNamed: (NSString *)  name  
 

Convenience method identical to [[element attributeNamed:name] value].

Available only as a sort of DOM-compliance, but with a proper name (not the DOM version: getAttribute()).

- (NSString *) valueOfAttributeNamed: (NSString *)  localName
inNamespace: (NSString *)  namespaceURI
prefix: (NSString *)  prefix
 
 

See valueOfAttributeNamed:.