org.jacoco.report.internal.xml

## Class XMLDocument

- java.lang.Object
- - org.jacoco.report.internal.xml.XMLElement
  - - org.jacoco.report.internal.xml.XMLDocument

Direct Known Subclasses:
  HTMLDocument

    public class XMLDocument
    extends XMLElement

Root element of an XML document. Each instance represents a separate output document.

See Also:
  `XMLElement`

### Field Summary

### Fields inherited from class org.jacoco.report.internal.xml.XMLElement

`writer`

### Constructor Summary

Constructors
Constructor and Description
`XMLDocument(String rootnode, String pubId, String system, String encoding, boolean standalone, OutputStream output)` Writes a new document to the given binary stream.
`XMLDocument(String rootnode, String pubId, String system, String encoding, boolean standalone, Writer writer)` Writes a new document to the given writer.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Closes this element if it has not been closed before.

### Methods inherited from class org.jacoco.report.internal.xml.XMLElement

`addChildElement, attr, attr, attr, beginOpenTag, element, text`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XMLDocument

    public XMLDocument(String rootnode,
                       String pubId,
                       String system,
                       String encoding,
                       boolean standalone,
                       Writer writer)
                throws IOException

Writes a new document to the given writer. The document might contain a document type declaration.

Parameters:
  `rootnode` - name of the root node
  `pubId` - optional doctype identifier or `null`
  `system` - system reference, required if doctype is given
  `encoding` - encoding that will be specified in the header
  `standalone` - `true` if this is a standalone document
  `writer` - writer for content output
Throws:
  `IOException` - in case of problems with the writer

#### XMLDocument

    public XMLDocument(String rootnode,
                       String pubId,
                       String system,
                       String encoding,
                       boolean standalone,
                       OutputStream output)
                throws IOException

Writes a new document to the given binary stream. The document might contain a document type declaration.

Parameters:
  `rootnode` - name of the root node
  `pubId` - optional doctype identifier or `null`
  `system` - system reference, required if doctype is given
  `encoding` - encoding of the XML document
  `standalone` - `true` if this is a standalone document
  `output` - output for content output
Throws:
  `IOException` - in case of problems with the writer

### Method Detail

#### close

    public void close()
               throws IOException

Description copied from class: `XMLElement`
Closes this element if it has not been closed before.

Overrides:
  `close` in class `XMLElement`
Throws:
  `IOException` - in case of problems with the writer