it will get all img. but I just want get phil_1,phil_2 use name="phil".
Can SAXparser do it? And how to do that.
It sounds like you're asking for a SAX filter though honestly that's overkill here. You could easily write something like this instead:
if (localName.equals("img")) { // do not ignore case
if ("phil".equals(attributes.getValue("name")) {
// do your work...