public static void main(String[] args) throws Exception {
		
		switch (args.length) {
		case 2:
			expr = args[1];
			/*FALLTHROUGH*/
		case 1:
			fileName = args[0];
			break;
		case 0:
		default:
			System.err.println("Usage: XPathRunner file [xpath-expr]\n");
			return;
		}

		DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
		document = parser.parse(new FileInputStream(fileName));

		if (expr == null) do {
			expr = promptForPathExpr();
			System.out.println(eval(expr));
		} while (!done);
		else {
			System.out.println(eval(expr));
		}
	}