Package writer2latex.office

# Class OfficeDocument

java.lang.Object
writer2latex.office.OfficeDocument

public class OfficeDocument extends Object
This class implements reading of ODF files from various sources

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final String`
`CONTENTXML`
`protected static final String`
`STYLESXML`

## Constructor Summary

Constructors
Constructor
Description
`OfficeDocument()`

## Method Summary

Modifier and Type
Method
Description
`Document`
`getContentDOM()`
Return a DOM `Document` object of the content.xml file.
`EmbeddedObject`
`getEmbeddedObject(String sName)`
Returns the embedded object corresponding to the name provided.
`Document`
`getMetaDOM()`
Return a DOM `Document` object of the meta.xml file.
`Document`
`getStyleDOM()`
Return a DOM `Document` object of the style.xml file.
`boolean`
`isPackageFormat()`
Package or flat format?
`void`
`read(InputStream is)`
Read the Office `Document` from the given `InputStream`.
`void`
`read(Document dom)`
Read the document from a DOM tree (flat XML format)
`protected void`
`removeEmbeddedObject(String sName)`

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

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

## Field Details

### CONTENTXML

protected static final String CONTENTXML

See Also:
  - Constant Field Values

### STYLESXML

protected static final String STYLESXML

See Also:
  - Constant Field Values

## Constructor Details

### OfficeDocument

public OfficeDocument()

## Method Details

### isPackageFormat

public boolean isPackageFormat()
Package or flat format?

Returns:
  true if the document is in package format, false if it's flat XML

### getContentDOM

public Document getContentDOM()
Return a DOM `Document` object of the content.xml file. file. Note that a content DOM is not created when the constructor is called, but only after the `read` method has been invoked

Returns:
  DOM `Document` object.

### getMetaDOM

public Document getMetaDOM()
Return a DOM `Document` object of the meta.xml file. Note that a meta DOM is not created when the constructor is called, but only after the `read` method has been invoked

Returns:
  DOM `Document` object.

### getStyleDOM

public Document getStyleDOM()
Return a DOM `Document` object of the style.xml file. Note that a style DOM is not created when the constructor is called, but only after the `read` method has been invoked

Returns:
  DOM `Document` object.

### getEmbeddedObject

public EmbeddedObject getEmbeddedObject(String sName)
Returns the embedded object corresponding to the name provided. The name should be stripped of any preceding path characters, such as '/', '.' or '#'.

Parameters:
  `sName` - The name of the embedded object to retrieve.
Returns:
  An `EmbeddedObject` instance representing the named object.

### removeEmbeddedObject

protected void removeEmbeddedObject(String sName)

### read

public void read(Document dom)
Read the document from a DOM tree (flat XML format)

Parameters:
  `dom` - the DOM tree

### read

public void read(InputStream is) throws IOException
Read the Office `Document` from the given `InputStream`. Performs simple type detection to determine package or flat format

Parameters:
  `is` - Office document `InputStream`.
Throws:
  `IOException` - If any I/O error occurs.
  `SAXException`