for (Iterator i = element.attributeIterator(); i.hasNext(); ) { Attribute attribute = (Attribute) i.next();
for (Iterator<Attribute> i = element.attributeIterator(); i.hasNext(); ) { Attribute attribute = i.next();
	public static void main(String[] argv) throws Exception {		if (argv.length != 2) {			System.err.println("Usage: " + XPathFind.class.getName() +				": <filename> <xpath expression>");			System.exit(1);		}		String fileName = argv[0];		String xpath = argv[1];		SAXReader reader = new SAXReader();		Document document = reader.read(fileName);		XPathFind finder = new XPathFind(document) {			protected void match(Node node) {				//System.out.println(node.toString());				if (node instanceof Element) {					Element element = (Element) node;					System.out.println("Element: " + element.getQualifiedName());					System.out.println("\tText: " + element.getText());					System.out.println("\tAttributes:");					for (Iterator i = element.attributeIterator(); i.hasNext(); ) {						Attribute attribute = (Attribute) i.next();						System.out.println("\t\t" + attribute.getName() + "=" + attribute.getValue());					}				} else if (node instanceof Attribute) {					Attribute attribute = (Attribute) node;					System.out.println("Attribute: " + attribute.getName() + "=" + attribute.getValue());				}			}		};		finder.find(xpath);	}