public class OdfXMLHelper extends Object
Constructor and Description |
---|
OdfXMLHelper() |
Modifier and Type | Method and Description |
---|---|
XMLReader |
newXMLReader(OdfPackage pkg)
create an XMLReader
with a Resolver set to parse content in a ODF Package
|
void |
parse(OdfPackage pkg,
String path,
ContentHandler contentHandler,
ErrorHandler errorHandler)
use SAX parser to parse content of package
|
void |
transform(OdfPackage pkg,
String path,
File template)
Do XSL-Transformation on content contained in package
insert result back to package
|
void |
transform(OdfPackage pkg,
String path,
File template,
File out)
Do XSL-Transformation on content contained in package
|
void |
transform(OdfPackage pkg,
String path,
Source templateSource,
File out)
Do XSL-Transformation on content contained in package
|
void |
transform(OdfPackage pkg,
String path,
Source templateSource,
Result result)
Do XSL-Transformation on content contained in package
|
void |
transform(OdfPackage pkg,
String path,
Source templateSource,
String outPath)
Do XSL-Transformation on content contained in package
|
void |
transform(OdfPackage pkg,
String path,
String templatePath)
Do XSL-Transformation on content contained in package
insert result back to package
|
void |
transform(OdfPackage pkg,
String path,
String templatePath,
String outPath)
Do XSL-Transformation on content contained in package
|
void |
transform(OdfPackage pkg,
String path,
Templates templates)
Do XSL-Transformation on content contained in package
and insert result back to package
|
void |
transform(OdfPackage pkg,
String path,
Templates templates,
Result result)
Does an XSL-Transformation on content contained in package.
There are three default parameteres provided to the transformation: There are three default parameteres provided to the transformation: sourceURL: the URL of the source directory sourceBaseURL: baseURL of the source file (the package). |
public XMLReader newXMLReader(OdfPackage pkg) throws SAXException, ParserConfigurationException
pkg
- the ODF PackageSAXException
ParserConfigurationException
public void parse(OdfPackage pkg, String path, ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException, ParserConfigurationException, IOException, IllegalArgumentException, TransformerConfigurationException, TransformerException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamcontentHandler
- a SAX Content handler to receive SAX EventserrorHandler
- a SAX Error handler to be called on errors during parsingSAXException
ParserConfigurationException
IOException
IllegalArgumentException
TransformerConfigurationException
TransformerException
public void transform(OdfPackage pkg, String path, String templatePath, String outPath) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplatePath
- a path to a file in the filesystem containing an XSL TemplateoutPath
- a path in the filesystem for the output of the XSL TransformationTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, Source templateSource, String outPath) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplateSource
- TraX Source of an XSL Transformation TemplateoutPath
- path to an output file for the XSL TransformationTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, Source templateSource, File out) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplateSource
- TraX Source of an XSL Transformationout
- an output FileTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, String templatePath) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplatePath
- path inside the filesystem to an XSL template fileTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, File template, File out) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplate
- File containing an XSLT Templateout
- File for the XSLT ouputTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, File template) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplate
- a File containing an XSLT TemplateTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, Source templateSource, Result result) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplateSource
- TraX Source of an XSLT Templateresult
- TraX Result of XSL-TranformationTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, Templates templates, Result result) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplates
- TraX XSLT Templateresult
- TraX XSLT ResultTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
public void transform(OdfPackage pkg, String path, Templates templates) throws TransformerConfigurationException, TransformerException, IOException, IllegalArgumentException, SAXException, ParserConfigurationException
pkg
- a OdfPackagepath
- a path inside the OdfPackage, eg. to a contained content.xml streamtemplates
- Trax XSLT TemplateTransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException
Copyright © 2013 myGrid. All rights reserved.