< DOMAttribute > Protocol Reference

Inheritance diagram for < DOMAttribute >:

< DOMNode > < DOMNamespaceAware > DOMAttribute List of all members.

Detailed Description

Represents an attribute of an element.

There is no need to create attribute objects yourself. To add attributes to an element, use DOMElement::setAttributeNamed:value: on an element node. You can then get a reference to the attribute object by using the DOMElement::attributeNamed: method, or get it's value directly with DOMElement::valueOfAttributeNamed:. Never create them yourself.

A word on namespaces: an attribute cannot have a prefix without being in a namespace (having a namespace URI). The methods setName: and setNamespaceURI:prefix: will raise exceptions if you try to set a name containing a colon or set a prefix without first having put the attribute in the namespace.


Public Member Functions

(NSString *)  name
(NSString *)  localName
(void)  setName:
(NSString *)  value
(void)  setValue:
(id< DOMElement >)  ownerElement
(BOOL)  isId
(void)  setIsId:

Member Function Documentation

- (BOOL) isId  
 

Whether or not this attribute is an ID attribute. To set this node as an ID attribute, use it's parent's DOMElement::setIdAttributeNamed:.

- (NSString *) localName  
 

Returns the local name of the attribute

- (NSString *) name  
 

Returns the qualified name of the attribute.

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

- (id <DOMElement>) ownerElement  
 

Returns the element containing this attribute.

- (void) setIsId: (BOOL)  state  
 

Sets the isId flag of this attribute. See isId.

- (void) setName: (NSString *)  name  
 

Sets the name of this attribute.

Exceptions:
DOMNamespaceException Raised if the name matches "xmlns" in any variation of case, "xmlns" is a reserved name.

- (void) setValue: (NSString *)  value  
 

Sets the value of this attribute.

- (NSString *) value  
 

Returns the value of the attribute.