FileDocCategorySizeDatePackage
JDOMLister.javaAPI DocExample695Wed Nov 21 15:44:48 GMT 2001None

JDOMLister

public class JDOMLister extends Object
List an XML file after building it into a JDOM Document. Notice it is easier than using SAX or DOM directly.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

 
		try {
			SAXBuilder b = new SAXBuilder(true);	// true -> validate

			// Create a JDOM document.
			Document doc = b.build(new File("parents+dtd.xml"));

			// Create an output formatter, and have it write the doc.
			new XMLOutputter().output(doc, System.out);
		} catch (JDOMException jex) {
			System.out.print("PARSE ERROR: " + jex.getMessage());
		} catch (Exception ex) {
			ex.printStackTrace();
		}