Infoset includes a flag saying whether a given attribute value was specified in the instance document or defaulted from the DTD.
DOM also wants to know this
Solution:
package org.xml.sax.ext;
public interface Attributes2 extends Attributes {
public boolean isSpecified (int index);
public boolean isSpecified (String uri, String localName);
public boolean isSpecified (String qualifiedName);
public boolean isDeclared (int index);
public boolean isDeclared (String uri, String localName);
public boolean isDeclared (String qualifiedName);
}
The isDeclared
methods
return false unless the attribute was declared in the DTD.
This interface would be implemented by SAX 2.1
Attributes
objects provided in
startElement()
callbacks
The read-only
http://xml.org/sax/features/use-attributes2 feature
specifies whether Attributes2
is available