|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.powerml.PresentationParser
Instances of this class are used to parse Microsoft PowerPoint
presentations. The parsed information can be accessed in several ways. Use
the various to...() methods for this.
Example: parse the file presentation.ppt and output parsed data as formatted XML to the console:
PresentationParser parser = new PresentationParser(new FileInputStream("presentation.ppt"));
parser.toFormattedXml(System.out);
| Constructor Summary | |
PresentationParser(java.io.InputStream inputStream)
Creates a new PresentationParser instance. |
|
| Method Summary | |
void |
setPurgeStrings(boolean purgeStrings)
By default, before generating XML from parsed data, the contained text is cleaned of control characters which would render the resulting XML document invalid. |
void |
setRoundPrecision(int roundPrecision)
Sets the rounding precision for floating point values in XML. |
void |
setSchemaLocation(java.lang.String schemaLocation)
This method allows to specify the PowerML schema location. |
void |
toCompressedXml(java.io.OutputStream outputStream)
This method transforms the parsed presentation data to ZLIB compressed XML and writes it to a stream. |
org.dom4j.Document |
toDom4JDocument()
Transforms the parsed presentation data to a dom4j document (see the dom4j site for further details). |
void |
toFormattedXml(java.io.OutputStream outputStream)
Transforms the parsed presentation data to formatted XML. |
org.w3c.dom.Document |
toW3CDocument()
Transforms the parsed presentation data to a W3C XML document. |
void |
toXml(java.io.OutputStream outputStream)
Transforms the parsed presentation data to (unformatted) XML which is written to an output stream. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PresentationParser(java.io.InputStream inputStream)
to...() methods.
inputStream - stream containing a PowerPoint file| Method Detail |
public void setPurgeStrings(boolean purgeStrings)
purgeStrings - specifies whether to clean strings of control
characters or notpublic void setRoundPrecision(int roundPrecision)
Sets the rounding precision for floating point values in XML. Specify the
number of digits after the decimal point. Invoke this method before one
of the to...() methods. Note that trailing zeros are
truncated, e.g. 1.8796 rounded with a precision of 3 is 1.88 and not
1.880.
The default is 6.
roundPrecision - rounding precision for FP numberspublic void setSchemaLocation(java.lang.String schemaLocation)
This method allows to specify the PowerML schema location. This can be useful in case you want to validate the generated XML against a local copy of the PowerML schema for increased performance.
If you specify a null schema location, the generated XML lacks any
reference to the PowerML schema. If this method is omitted, the XML will
contain a reference to
http://www.powerml.com/schema/powerml.xsd.
schemaLocation - location of the schema file
public void toCompressedXml(java.io.OutputStream outputStream)
throws java.io.IOException,
InvalidFormatException
outputStream - target output stream
java.io.IOException - if an I/O error occured
InvalidFormatException - if the PowerPoint file is not valid
public org.dom4j.Document toDom4JDocument()
throws java.io.IOException,
InvalidFormatException
java.io.IOException - if an I/O error occured
InvalidFormatException - if the PowerPoint file is not valid
public void toFormattedXml(java.io.OutputStream outputStream)
throws java.io.IOException,
InvalidFormatException
outputStream - the target output stream
java.io.IOException - if an I/O error occured
InvalidFormatException - if the PowerPoint file is not valid
public org.w3c.dom.Document toW3CDocument()
throws java.io.IOException,
InvalidFormatException,
org.dom4j.DocumentException
java.io.IOException - if an I/O error occured
InvalidFormatException - if the PowerPoint file is not valid
org.dom4j.DocumentException - if conversion to W3C document failed
public void toXml(java.io.OutputStream outputStream)
throws java.io.IOException,
InvalidFormatException
outputStream - target output stream
java.io.IOException - if an I/O error occured
InvalidFormatException - if the PowerPoint file is not valid
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||