The Attributes2 Interface
SAX 2.0.2 adds an Attributes2
subclass of Attributes
that provides extra methods
to determine whether a given attribute was declared in the DTD
and/or specified in the instance document (as opposed to being
defaulted in from the DTD). A parser that supports Attributes2
will pass an Attributes2
object to startElement( )
instead of a plain
Attributes
object. Using the
extra methods requires a cast. Before casting, you may wish to
check whether the cast will succeed by getting the value of the
http://xml.org/sax/features/use-attributes2
feature. If this feature is true, the parser passes Attributes2
objects.
package org.xml.sax.ext; public interfaceAttributes2
{ public booleanisDeclared
(intindex
); public booleanisDeclared
(StringqualifiedName
); public booleanisSpecified
(StringnamespaceURI
, StringlocalName
); public booleanisSpecified
(intindex
); public booleanisSpecified
(StringqualifiedName
); public booleanisSpecified
(StringnamespaceURI
, StringlocalName
); }