A class that defines the set of Attributes of an Element and provides operations for accessing elements in that set.
| Public Methods | |
|---|---|
| << | Alias for #add |
| [] | Fetches an attribute value. If you want to get the Attribute itself, use get_attribute() |
| []= | Sets an attribute, overwriting any existing attribute value by the same name. Namespace is significant. |
| add | Adds an attribute, overriding any existing attribute by the same name. Namespaces are significant. |
| delete | Removes an attribute |
| delete_ |
Deletes all attributes matching a name. Namespaces are significant. |
| each | Itterates over each attribute of an Element, yielding the expanded name and value as a pair of Strings. |
| each_ |
Itterates over the attributes of an Element. Yields actual Attribute nodes, not String values. |
| get_ |
Fetches an attribute |
| get_ |
The get_attribute_ns method retrieves a method by its namespace and name. Thus it is possible to reliably identify an attribute even if an XML processor has changed the prefix. |
| length | Returns the number of attributes the owning Element contains. |
| namespaces | |
| new | Constructor |
| prefixes | Returns an array of Strings containing all of the prefixes declared by this set of # attributes. The array does not include the default namespace declaration, if one exists. |
| size | Alias for #length |
| to_ |
|
<code/>and<pre/>for code samples.