/* Copyright 2003, 2019 Elliotte Rusty Harold
This library is free software; you can redistribute it and/or modify
it under the terms of version 2.1 of the GNU Lesser General Public
License as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see
* Demonstrates walking the tree while collecting * element and attribute names and types. *
* * @author Elliotte Rusty Harold * @version 1.3.1 * */ public class DTDGenerator { public static void main(String[] args) { if (args.length == 0) { System.err.println( "Usage: java nu.xom.samples.DTDGenerator URL" ); return; } try { Builder builder = new Builder(new NamingNodeFactory()); builder.build(args[0]); } catch (IOException ex) { System.err.println("Could not read " + args[0] + " due to " + ex.getMessage()); } catch (ParsingException ex) { System.err.println(args[0] + " is not well-formed"); } } private static class NamingNodeFactory extends NodeFactory { private List