Interface for an element's attribute specifications
Constructors and Destructor
| |||||
private | Constructors and operators
| ||||
The virtual attribute list interface |
Interface for an element's attribute specifications. The SAX parser implements this interface and passes an instance to the SAX application as the second argument of each startElement event. The instance provided will return valid results only during the scope of the startElement invocation (to save it for future use, the application must make a copy: the AttributeListImpl helper class provides a convenient constructor for doing so). An AttributeList includes only attributes that have been specified or defaulted: #IMPLIED attributes will not be included. There are two ways for the SAX application to obtain information from the AttributeList. First, it can iterate through the entire list:public void startElement (String name, AttributeList atts) { for (int i = 0; i < atts.getLength(); i++) { String name = atts.getName(i); String type = atts.getType(i); String value = atts.getValue(i); [...] } }(Note that the result of getLength() will be zero if there are no attributes.) As an alternative, the application can request the value or type of specific attributes:public void startElement (String name, AttributeList atts) { String identifier = atts.getValue("id"); String label = atts.getValue("label"); [...] }The AttributeListImpl helper class provides a convenience implementation for use by parser or application writers. $Log: AttributeList.hpp,v $ Revision 1.1.1.1 1999/11/09 01:07:43 twl Initial checkin Revision 1.2 1999/11/08 20:44:54 rahul Swat for adding in Product name and CVS comment log variable.
getType(String)
getValue(String)
alphabetic index hierarchy of classes
XML Parser for C++ 2.0 Copyright © IBM Corp, 1999 Center for Java Technology 10275 N. De Anza Blvd. Cupertino CA 95014 USA Email: xml4c@us.ibm.com |
|