Parsing a document

try {
  Builder parser = new Builder();
  Document doc = parser.build(url);
  System.out.println(doc.toXML());
}
catch (ParsingException ex) {
  System.out.println(url + " is not well-formed.");
  System.out.println(ex.getMessage());
}
catch (IOException ex) { 
  System.out.println("Due to an IOException, "
  + "the parser could not check " + args[0]); 
}

Previous | Next | Top | Cafe con Leche

Copyright 2004 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 5, 2004