Package writer2latex.office
Class OfficeDocument
- java.lang.Object
-
- writer2latex.office.OfficeDocument
-
public class OfficeDocument extends java.lang.ObjectThis class implements reading of ODF files from various sources
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCONTENTXMLprotected static java.lang.StringSTYLESXML
-
Constructor Summary
Constructors Constructor Description OfficeDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.DocumentgetContentDOM()Return a DOMDocumentobject of the content.xml file.EmbeddedObjectgetEmbeddedObject(java.lang.String sName)Returns the embedded object corresponding to the name provided.org.w3c.dom.DocumentgetMetaDOM()Return a DOMDocumentobject of the meta.xml file.org.w3c.dom.DocumentgetStyleDOM()Return a DOMDocumentobject of the style.xml file.booleanisPackageFormat()Package or flat format?voidread(java.io.InputStream is)Read the OfficeDocumentfrom the givenInputStream.voidread(org.w3c.dom.Document dom)Read the document from a DOM tree (flat XML format)protected voidremoveEmbeddedObject(java.lang.String sName)
-
-
-
Field Detail
-
CONTENTXML
protected static final java.lang.String CONTENTXML
- See Also:
- Constant Field Values
-
STYLESXML
protected static final java.lang.String STYLESXML
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 org.w3c.dom.Document 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
public org.w3c.dom.Document 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
public org.w3c.dom.Document 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
public EmbeddedObject getEmbeddedObject(java.lang.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
EmbeddedObjectinstance representing the named object.
-
removeEmbeddedObject
protected void removeEmbeddedObject(java.lang.String sName)
-
read
public void read(org.w3c.dom.Document dom)
Read the document from a DOM tree (flat XML format)- Parameters:
dom- the DOM tree
-
read
public void read(java.io.InputStream is) throws java.io.IOExceptionRead the OfficeDocumentfrom the givenInputStream. Performs simple type detection to determine package or flat format- Parameters:
is- Office documentInputStream.- Throws:
java.io.IOException- If any I/O error occurs.org.xml.sax.SAXException
-
-