com.icl.saxon.tree
public final class AttributeCollection extends Object implements Attributes
Constructor Summary | |
---|---|
AttributeCollection(NamePool pool)
Create an empty attribute list. | |
AttributeCollection(NamePool pool, int n)
Create an empty attribute list with space for n attributes | |
AttributeCollection(AttributeCollection atts)
Create a new attribute collection as a clone | |
AttributeCollection(NamePool pool, Attributes atts)
Create a new attribute collection as a clone |
Method Summary | |
---|---|
void | addAttribute(int nameCode, String type, String value)
Add an attribute to an attribute list. |
void | addAttribute(String prefix, String uri, String localName, String type, String value)
Add an attribute to an attribute list. |
void | clear()
Clear the attribute list. |
void | compact()
Compact the attribute list to avoid wasting memory |
int | getIndex(String name)
Get the index of an attribute (by name).
|
int | getIndex(String uri, String localname)
Get the index of an attribute (by name).
|
int | getIndexByFingerprint(int fingerprint)
Get the index, given the fingerprint |
int | getLength()
Return the number of attributes in the list. |
String | getLocalName(int index)
Get the local name of an attribute (by position).
|
int | getNameCode(int index)
Get the namecode of an attribute (by position).
|
String | getQName(int index)
Get the display name of an attribute (by position).
|
String | getType(int index)
Get the type of an attribute (by position). |
String | getType(String uri, String localname)
Get the type of an attribute (by name).
|
String | getType(String name)
Get the type of an attribute (by name).
|
String | getURI(int index)
Get the namespace URI of an attribute (by position).
|
String | getValue(int index)
Get the value of an attribute (by position).
|
String | getValue(String uri, String localname)
Get the value of an attribute (by name).
|
String | getValue(String name)
Get the value of an attribute (by name).
|
String | getValueByFingerprint(int fingerprint)
Get the attribute value using its fingerprint |
void | setAttribute(String prefix, String uri, String localName, String type, String value)
Set an attribute value |
void | setAttribute(int nameCode, String type, String value)
Set an attribute value |
Parameters: name The attribute name. type The attribute type ("NMTOKEN" for an enumeration). value The attribute value (must not be null).
See Also: org.xml.sax.DocumentHandler#startElement
Parameters: prefix The namespace prefix of the attribute name. uri The namespace uri of the attribute name. localname The local part of the attribute name. type The attribute type (e.g. "NMTOKEN"). value The attribute value (must not be null).
See Also: org.xml.sax.DocumentHandler#startElement
Parameters: name The display name of the attribute.
Returns: The index position of the attribute
Parameters: uri The namespace uri of the attribute. localname The local name of the attribute.
Returns: The index position of the attribute
Returns: The number of attributes in the list.
Parameters: i The position of the attribute in the list.
Returns: The local name of the attribute as a string, or null if there is no attribute at that position.
Parameters: i The position of the attribute in the list.
Returns: The display name of the attribute as a string, or null if there is no attribute at that position.
Parameters: i The position of the attribute in the list.
Returns: The display name of the attribute as a string, or null if there is no attribute at that position.
Parameters: index The position of the attribute in the list.
Returns: The attribute type as a string ("NMTOKEN" for an enumeration, and "CDATA" if no declaration was read), or null if there is no attribute at that position.
Parameters: uri The namespace uri of the attribute. localname The local name of the attribute.
Returns: The index position of the attribute
Parameters: name The display name of the attribute.
Returns: The attribute type as a string ("NMTOKEN" for an enumeration, and "CDATA" if no declaration was read).
Parameters: index The position of the attribute in the list.
Returns: The local name of the attribute as a string, or null if there is no attribute at that position.
Parameters: index The position of the attribute in the list.
Returns: The attribute value as a string, or null if there is no attribute at that position.
Parameters: uri The namespace uri of the attribute. localname The local name of the attribute.
Returns: The index position of the attribute
Parameters: name The attribute name.
Parameters: name the name of the attribute type the type of the attribute (e.g. CDATA) value the value of the attribute
Parameters: name the name of the attribute type the type of the attribute (e.g. CDATA) value the value of the attribute