
if(null != attribute)
{
double price = toDouble(attribute);
if(min > price)
{
min = price;
vendor = attributes.getValue(“vendor”);
}
}
}
}
The parser uses AttributeList in the startElement event. As the name
implies, an
AttributeList encapsulates a list of attributes. It defines the
following methods:
• getLength() returns the length of the attribute list.
•
getName(i) returns the name of the ith attribute (where i is an integer).
• getType(i)/getType(name) return the type of the ith attribute or the
type of the attribute whose name is given. The first method accepts an
integer, the second a string. The type is a string, as used in the DTD:
“CDATA”, “ID”, “IDREF” ...