writer2latex.xmerge

Class DOMDocument

public class DOMDocument extends Object implements Document

An implementation of Document for StarOffice documents.
Constructor Summary
DOMDocument(String name, String ext)
Default constructor.
DOMDocument(String name, String ext, boolean namespaceAware, boolean validating)
Constructor with arguments to set namespaceAware and validating flags.
Method Summary
DocumentgetContentDOM()
Return a DOM Document object of the document content file.
protected StringgetFileExtension()
Returns the file extension of the Document represented.
StringgetFileName()
Return the file name of the Document, possibly with the standard extension.
StringgetName()
Return the name of the Document.
voidinitContentDOM()
Initializes a new DOM Document with the content containing minimum XML tags.
voidread(InputStream is)
Read the Office Document from the specified InputStream.
voidsetContentDOM(Node newDom)
Sets the Content of the Document to the contents of the supplied Node list.
voidwrite(OutputStream os)
Write out content to the supplied OutputStream.

Constructor Detail

DOMDocument

public DOMDocument(String name, String ext)
Default constructor.

Parameters: name Document name. ext Document extension.

DOMDocument

public DOMDocument(String name, String ext, boolean namespaceAware, boolean validating)
Constructor with arguments to set namespaceAware and validating flags.

Parameters: name Document name (may or may not contain extension). ext Document extension. namespaceAware Value for namespaceAware flag. validating Value for validating flag.

Method Detail

getContentDOM

public Document getContentDOM()
Return a DOM Document object of the document content file. Note that a content DOM is not created when the constructor is called. So, either the read method or the initContentDOM method will need to be called ahead on this object before calling this method.

Returns: DOM Document object.

getFileExtension

protected String getFileExtension()
Returns the file extension of the Document represented.

Returns: file extension of the Document.

getFileName

public String getFileName()
Return the file name of the Document, possibly with the standard extension.

Returns: The file name of Document.

getName

public String getName()
Return the name of the Document.

Returns: The name of Document.

initContentDOM

public final void initContentDOM()
Initializes a new DOM Document with the content containing minimum XML tags.

Throws: IOException If any I/O error occurs.

read

public void read(InputStream is)
Read the Office Document from the specified InputStream.

Parameters: is Office document InputStream.

Throws: IOException If any I/O error occurs.

setContentDOM

public void setContentDOM(Node newDom)
Sets the Content of the Document to the contents of the supplied Node list.

Returns: DOM Document object.

write

public void write(OutputStream os)
Write out content to the supplied OutputStream.

Parameters: os XML OutputStream.

Throws: IOException If any I/O error occurs.