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 e) {
        System.err.println(e); 
      }


Previous | Next | Top | Cafe con Leche

Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 22, 2000