I am extending HTMLEditorKit.ParserCallback to parse HTML. I am matching on a certain element type in an overridden method like this:
@Override
public void handleStartTag(Tag t, MutableAttributeSet a, int pos) {
if (Tag.DIV.equals(t)) {
String id = (String) a.getAttribute("id");
String clazz = (String) a.getAttribute("class");
...
After this line, id and clazz are always null, yet I know for a fact the element in question contains these attributes.
How should I retrieve these attributes?