Name

Attributes2

Synopsis

This interface extends org.xml.sax.Attributes and adds methods for determining if an attribute was declared in the DTD and whether an attribute value was explicitly specified in the document or whether a default value from the DTD was used. If the SAX implementation supports this interface, the Attributes object passed to the startElement( ) method of the ContentHandler implements this interface. You can also test for support by querying the feature named “http://xml.org/sax/features/use-attributes2” with XMLReader.getFeature( ).

org.xml.sax.ext.Attributes2

Figure 22-7. org.xml.sax.ext.Attributes2

public interface Attributes2 extends org.xml.sax.Attributes {
// Public Instance Methods
     boolean isDeclared(String qName);  
     boolean isDeclared(int index);  
     boolean isDeclared(String uri, String localName);  
     boolean isSpecified(String qName);  
     boolean isSpecified(int index);  
     boolean isSpecified(String uri, String localName);  
}

Implementations

Attributes2Impl

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.