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 ofDocumentfor XHTML documents.
-
-
Field Summary
Fields Modifier and Type Field Description static intHTML5Constant to identify HTML5 documentsstatic intXHTML_MATHMLConstant to identify XHTML + MathML documentsstatic intXHTML10Constant to identify XHTML 1.0 strict documentsstatic intXHTML11Constant to identify XHTML 1.1 documents
-
Constructor Summary
Constructors Constructor Description XhtmlDocument(java.lang.String name, int nType)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateHeaderFooter()org.w3c.dom.ElementgetBodyNode()org.w3c.dom.ElementgetContentNode()java.lang.StringgetEncoding()static java.lang.StringgetExtension(int nType)java.lang.StringgetFileExtension()Returns the file extension of theDocumentrepresented.org.w3c.dom.ElementgetFooterNode()org.w3c.dom.ElementgetHeaderNode()org.w3c.dom.ElementgetHeadNode()java.lang.StringgetMIMEType()Get the MIME type of theOutputFile.org.w3c.dom.ElementgetPanelNode()org.w3c.dom.ElementgetTitleNode()booleanhasMath()Does this document contain any math nodes?booleanisMasterDocument()Test whether this document is part of the main document flow (master documents) or an auxiliary documentvoidread(java.io.InputStream is)Read the OfficeDocumentfrom the specifiedInputStream.voidreadFromTemplate(XhtmlDocument template)voidsetConfig(XhtmlConfig config)voidsetContentDOM(org.w3c.dom.Document doc)voidsetContentNode(org.w3c.dom.Element contentNode)voidwrite(java.io.OutputStream os)Write out content to the suppliedOutputStream.-
Methods inherited from class writer2latex.base.DOMDocument
getContentDOM, getFileName, getName, initContentDOM, setContentDOM
-
-
-
-
Field Detail
-
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
-
-
Method Detail
-
getExtension
public static final java.lang.String getExtension(int nType)
-
getMIMEType
public java.lang.String getMIMEType()
Description copied from interface:OutputFileGet the MIME type of theOutputFile.- Specified by:
getMIMETypein interfaceOutputFile- Overrides:
getMIMETypein classDOMDocument- Returns:
- string representation of the MIME type
-
isMasterDocument
public boolean isMasterDocument()
Description copied from interface:OutputFileTest whether this document is part of the main document flow (master documents) or an auxiliary document- Specified by:
isMasterDocumentin interfaceOutputFile- Overrides:
isMasterDocumentin classDOMDocument- Returns:
- true if this document is a master document
-
getHeadNode
public org.w3c.dom.Element getHeadNode()
-
getBodyNode
public org.w3c.dom.Element getBodyNode()
-
getTitleNode
public org.w3c.dom.Element getTitleNode()
-
getContentNode
public org.w3c.dom.Element getContentNode()
-
setContentNode
public void setContentNode(org.w3c.dom.Element contentNode)
-
getPanelNode
public org.w3c.dom.Element getPanelNode()
-
getHeaderNode
public org.w3c.dom.Element getHeaderNode()
-
getFooterNode
public org.w3c.dom.Element getFooterNode()
-
createHeaderFooter
public void createHeaderFooter()
-
setContentDOM
public void setContentDOM(org.w3c.dom.Document doc)
-
hasMath
public boolean hasMath()
Does this document contain any math nodes?- Returns:
- true if so
-
read
public void read(java.io.InputStream is) throws java.io.IOExceptionDescription copied from class:DOMDocumentRead the OfficeDocumentfrom the specifiedInputStream.- Overrides:
readin classDOMDocument- Parameters:
is- Office documentInputStream.- Throws:
java.io.IOException- If any I/O error occurs.
-
readFromTemplate
public void readFromTemplate(XhtmlDocument template)
-
setConfig
public void setConfig(XhtmlConfig config)
-
getEncoding
public java.lang.String getEncoding()
-
getFileExtension
public java.lang.String getFileExtension()
Description copied from class:DOMDocumentReturns the file extension of theDocumentrepresented.- Overrides:
getFileExtensionin classDOMDocument- Returns:
- file extension of the
Document.
-
write
public void write(java.io.OutputStream os) throws java.io.IOExceptionWrite out content to the suppliedOutputStream. (with pretty printing)- Specified by:
writein interfaceOutputFile- Overrides:
writein classDOMDocument- Parameters:
os- XMLOutputStream.- Throws:
java.io.IOException- If any I/O error occurs.
-
-