Package writer2latex.office
Class OfficeDocument
java.lang.Object
writer2latex.office.OfficeDocument
This class implements reading of ODF files from various sources
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn a DOMDocumentobject of the content.xml file.getEmbeddedObject(String sName) Returns the embedded object corresponding to the name provided.Return a DOMDocumentobject of the meta.xml file.Return a DOMDocumentobject of the style.xml file.booleanPackage or flat format?voidread(InputStream is) Read the OfficeDocumentfrom the givenInputStream.voidRead the document from a DOM tree (flat XML format)protected voidremoveEmbeddedObject(String sName)
-
Field Details
-
CONTENTXML
- See Also:
-
STYLESXML
- See Also:
-
-
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
Return a DOMDocumentobject of the content.xml file. file. Note that a content DOM is not created when the constructor is called, but only after thereadmethod has been invoked- Returns:
- DOM
Documentobject.
-
getMetaDOM
Return a DOMDocumentobject of the meta.xml file. Note that a meta DOM is not created when the constructor is called, but only after thereadmethod has been invoked- Returns:
- DOM
Documentobject.
-
getStyleDOM
Return a DOMDocumentobject of the style.xml file. Note that a style DOM is not created when the constructor is called, but only after thereadmethod has been invoked- Returns:
- DOM
Documentobject.
-
getEmbeddedObject
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
EmbeddedObjectinstance representing the named object.
-
removeEmbeddedObject
-
read
Read the document from a DOM tree (flat XML format)- Parameters:
dom- the DOM tree
-
read
Read the OfficeDocumentfrom the givenInputStream. Performs simple type detection to determine package or flat format- Parameters:
is- Office documentInputStream.- Throws:
IOException- If any I/O error occurs.SAXException
-