protected Attribute attribute(String namespaceURI, String localName) {
List attributes = attributeList();
int size = attributes.size();
for (int i = 0; i < size; i++) {
Attribute attribute = (Attribute) attributes.get(i);
if (localName.equals(attribute.getName())
&& (((namespaceURI == null || namespaceURI.length() == 0)
&& ((attribute.getNamespaceURI() == null)
|| (attribute.getNamespaceURI().length() == 0)))
|| ((namespaceURI != null) && namespaceURI
.equals(attribute.getNamespaceURI())))) {
return attribute;
}
}
return null;