Better formatted output

 try {
  // Now that the document is created we need to *serialize* it
  OutputFormat format = new OutputFormat(fibonacci, "8859_1", true);
  format.setLineSeparator("\r\n");
  format.setLineWidth(72);
  format.setDoctype(null, "fibonacci.dtd");
  XMLSerializer serializer = new XMLSerializer(System.out, format);
  serializer.serialize(root);
}
catch (IOException ex) {
  System.err.println(ex); 
}

Previous | Next | Top | Cafe con Leche

Copyright 2002-2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified December 11, 2005