FileDocCategorySizeDatePackage
JDOMLister.javaAPI DocExample756Sat Mar 20 14:50:38 GMT 2004None

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("people+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();
		}