public interface XMLAttributes extends Attributes2
The attributes are read-write so that subsequent stages in the document pipeline can modify the values or change the attributes that are propagated to the next stage.
| Modifier and Type | Method and Description |
|---|---|
int |
addAttribute(QName attrName,
String attrType,
String attrValue)
Adds an attribute.
|
QName |
getName(int attrIndex)
Returns the QName structure of the name.
|
void |
getName(int attrIndex,
QName attrName)
Gets the fields in the given QName structure with the values of the attribute
name at the specified index.
|
String |
getNonNormalizedValue(int attrIndex) |
void |
removeAllAttributes()
Removes all of the attributes.
|
void |
removeAttributeAt(int attrIndex)
Removes the attribute at the specified index.
|
void |
setName(int attrIndex,
QName attrName)
Sets the name of the attribute at the specified index.
|
void |
setSpecified(int attrIndex,
boolean specified)
Sets whether an attribute is specified in the instance document or not.
|
void |
setValue(int attrIndex,
String attrValue)
Sets the value of the attribute at the specified index.
|
isDeclared, isDeclared, isDeclared, isSpecified, isSpecified, isSpecifiedint addAttribute(QName attrName, String attrType, String attrValue)
setSpecified method.
Note: If an attribute of the same name already exists, the old values for the attribute are replaced by the new values.
attrName - The attribute name.attrType - The attribute type. The type name is determined by the type
specified for this attribute in the DTD. For example:
"CDATA", "ID", "NMTOKEN", etc. However, attributes of type
enumeration will have the type value specified as the pipe
('|') separated list of the enumeration values prefixed by
an open parenthesis and suffixed by a close parenthesis. For
example: "(true|false)".attrValue - The attribute value.setSpecified(int, boolean)void removeAllAttributes()
void removeAttributeAt(int attrIndex)
Note: This operation changes the indexes of all attributes following the attribute at the specified index.
attrIndex - The attribute index.void setName(int attrIndex,
QName attrName)
attrIndex - The attribute index.attrName - The new attribute name.void getName(int attrIndex,
QName attrName)
attrIndex - The attribute index.attrName - The attribute name structure to fill in.QName getName(int attrIndex)
attrIndex - The attribute index.void setValue(int attrIndex,
String attrValue)
attrIndex - The attribute index.attrValue - The new attribute value.String getNonNormalizedValue(int attrIndex)
attrIndex - The attribute index.getValue(int) method.void setSpecified(int attrIndex,
boolean specified)
attrIndex - The attribute index.specified - True if the attribute is specified in the instance document.Copyright © 2025 HtmlUnit. All rights reserved.