Package diva.util.xml

Class XmlWriter


  • public class XmlWriter
    extends LoggableOp
    Given a tree of XmlElements, an object of this class generates the equivalent XML into an output stream.
    Version:
    $Id$
    Author:
    Copyright (c) 1997, 1998 by Microstar Software Ltd.;, written by David Megginson <dmeggins@microstar.com>, Steve Neuendorffer, John Reekie
    • Constructor Detail

      • XmlWriter

        public XmlWriter()
    • Method Detail

      • setXMLVersion

        public void setXMLVersion​(java.lang.String v)
        Set the XML version string. The default is 1.0.
      • write

        public void write​(XmlDocument document)
                   throws java.io.IOException
        Write the given XmlDocument to its URL. If the file or URL of the document cannot be opened for writing, then an IOException will be thrown.
        Throws:
        java.io.IOException
      • write

        public void write​(XmlDocument document,
                          java.io.Writer out)
                   throws java.io.IOException
        Write the given XmlDocument to a given Writer. If an error occurs while writing, then an IOException will be thrown.
        Throws:
        java.io.IOException
      • write

        @Deprecated
        public void write​(XmlElement e,
                          java.io.Writer out,
                          java.lang.String prefix)
                   throws java.io.IOException
        Deprecated.
        Use XmlElement.writeXML instead.
        Write a single XML element out to the given writer. Prefix each line with the given string. The writer is not flushed -- the caller must do this if necessary.
        Throws:
        java.io.IOException
      • writeDTD

        public void writeDTD​(XmlDocument document,
                             java.io.Writer out)
                      throws java.io.IOException
        Write the DTD of the given XmlDocument to a given Writer. If an error occurs while writing, then an IOException will be thrown.
        Throws:
        java.io.IOException
      • writeDTDNotations

        public void writeDTDNotations​(java.io.Writer out)
                               throws java.io.IOException
        Produce normalised declarations for all notations.
        Throws:
        java.io.IOException
      • writeDTDEntities

        public void writeDTDEntities​(java.io.Writer out)
                              throws java.io.IOException
        Produce normalised declarations for all general entities.
        Throws:
        java.io.IOException
      • writeDTDElements

        public void writeDTDElements​(java.io.Writer out)
                              throws java.io.IOException
        Produce normalised declarations for all elements.
        Throws:
        java.io.IOException