public static void main(String[] args) throws Exception
{
org.jdom.contrib.input.scanner.XPathMatcher.setDebug(true);
ElementScanner scanner = new ElementScanner();
scanner.addElementListener(new Spy("Listener #1 - \"x//y\""), "x//y");
scanner.addElementListener(new Spy("Listener #2 - \"y/*/y\""), "y/*/y");
scanner.addElementListener(new Spy("Listener #3 - \"/*\""), "/*");
scanner.addElementListener(new Spy("Listener #4 - \"z\""), "z");
scanner.addElementListener(new Spy("Listener #5 - \"*[contains(@name,'.1')]\""),
"*[contains(@name,'.1')]");
scanner.addElementListener(new Spy("Listener #6 - \"y[.//y]\""),
"y[.//y]");
String input = "test.xml";
if (args.length > 0)
{
input = args[0];
}
scanner.parse(new InputSource(input));
}