Package writer2latex.xhtml

# Class XhtmlDocument

java.lang.Object
writer2latex.base.DOMDocument
writer2latex.xhtml.XhtmlDocument

All Implemented Interfaces:
  `OutputFile`

public class XhtmlDocument extends DOMDocument
An implementation of `Document` for XHTML documents.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`HTML5`
Constant to identify HTML5 documents
`static final int`
`XHTML_MATHML`
Constant to identify XHTML + MathML documents
`static final int`
`XHTML10`
Constant to identify XHTML 1.0 strict documents
`static final int`
`XHTML11`
Constant to identify XHTML 1.1 documents
`static final int`
`XHTML5`
Constant to identify HTML5 documents with .xhtml extension

## Constructor Summary

Constructors
Constructor
Description
`XhtmlDocument(String name, int nType)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`containsMath()`
Test whether this document contains mathematical formulas
`void`
`createHeaderFooter()`
`Element`
`getBodyNode()`
`Element`
`getContentNode()`
`String`
`getEncoding()`
`static final String`
`getExtension(int nType)`
`String`
`getFileExtension()`
Returns the file extension of the `Document` represented.
`Element`
`getFooterNode()`
`Element`
`getHeaderNode()`
`Element`
`getHeadNode()`
`String`
`getMIMEType()`
Get the MIME type of the `OutputFile`.
`Element`
`getPanelNode()`
`Element`
`getTitleNode()`
`boolean`
`hasMath()`
Does this document contain any math nodes?
`boolean`
`isMasterDocument()`
Test whether this document is part of the main document flow (master documents) or an auxiliary document
`void`
`read(InputStream is)`
Read the Office `Document` from the specified `InputStream`.
`void`
`readFromTemplate(XhtmlDocument template)`
`void`
`setConfig(XhtmlConfig config)`
`void`
`setContentDOM(Document doc)`
`void`
`setContentNode(Element contentNode)`
`void`
`write(OutputStream os)`
Write out content to the supplied `OutputStream`.

### Methods inherited from class writer2latex.base.DOMDocument

`getContentDOM, getFileName, getName, initContentDOM, setContentDOM`

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

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

## Field Details

### XHTML10

public static final int XHTML10
Constant to identify XHTML 1.0 strict documents

See Also:
  - Constant Field Values

### XHTML11

public static final int XHTML11
Constant to identify XHTML 1.1 documents

See Also:
  - Constant Field Values

### XHTML_MATHML

public static final int XHTML_MATHML
Constant to identify XHTML + MathML documents

See Also:
  - Constant Field Values

### HTML5

public static final int HTML5
Constant to identify HTML5 documents

See Also:
  - Constant Field Values

### XHTML5

public static final int XHTML5
Constant to identify HTML5 documents with .xhtml extension

See Also:
  - Constant Field Values

## Constructor Details

### XhtmlDocument

public XhtmlDocument(String name, int nType)
Constructor. This constructor also creates the DOM (minimal: root, head, title and body node only)

Parameters:
  `name` - name of this document
  `nType` - the type of document

## Method Details

### getExtension

public static final String getExtension(int nType)

### getMIMEType

public String getMIMEType()
Description copied from interface: `OutputFile`
Get the MIME type of the `OutputFile`.

Specified by:
  `getMIMEType` in interface `OutputFile`
Overrides:
  `getMIMEType` in class `DOMDocument`
Returns:
  string representation of the MIME type

### isMasterDocument

public boolean isMasterDocument()
Description copied from interface: `OutputFile`
Test whether this document is part of the main document flow (master documents) or an auxiliary document

Specified by:
  `isMasterDocument` in interface `OutputFile`
Overrides:
  `isMasterDocument` in class `DOMDocument`
Returns:
  true if this document is a master document

### containsMath

public boolean containsMath()
Description copied from interface: `OutputFile`
Test whether this document contains mathematical formulas

Specified by:
  `containsMath` in interface `OutputFile`
Overrides:
  `containsMath` in class `DOMDocument`
Returns:
  true if the document contains formulas

### getHeadNode

public Element getHeadNode()

### getBodyNode

public Element getBodyNode()

### getTitleNode

public Element getTitleNode()

### getContentNode

public Element getContentNode()

### setContentNode

public void setContentNode(Element contentNode)

### getPanelNode

public Element getPanelNode()

### getHeaderNode

public Element getHeaderNode()

### getFooterNode

public Element getFooterNode()

### createHeaderFooter

public void createHeaderFooter()

### setContentDOM

public void setContentDOM(Document doc)

### hasMath

public boolean hasMath()
Does this document contain any math nodes?

Returns:
  true if so

### read

public void read(InputStream is) throws IOException
Description copied from class: `DOMDocument`
Read the Office `Document` from the specified `InputStream`.

Overrides:
  `read` in class `DOMDocument`
Parameters:
  `is` - Office document `InputStream`.
Throws:
  `IOException` - If any I/O error occurs.

### readFromTemplate

public void readFromTemplate(XhtmlDocument template)

### setConfig

public void setConfig(XhtmlConfig config)

### getEncoding

public String getEncoding()

### getFileExtension

public String getFileExtension()
Description copied from class: `DOMDocument`
Returns the file extension of the `Document` represented.

Overrides:
  `getFileExtension` in class `DOMDocument`
Returns:
  file extension of the `Document`.

### write

public void write(OutputStream os) throws IOException
Write out content to the supplied `OutputStream`. (with pretty printing)

Specified by:
  `write` in interface `OutputFile`
Overrides:
  `write` in class `DOMDocument`
Parameters:
  `os` - XML `OutputStream`.
Throws:
  `IOException` - If any I/O error occurs.