org.odftoolkit.odfdom.pkg
Class OdfXMLHelper

java.lang.Object
  extended by org.odftoolkit.odfdom.pkg.OdfXMLHelper

public class OdfXMLHelper
extends Object


Constructor Summary
OdfXMLHelper()
           
 
Method Summary
 XMLReader createXMLReader(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)
          Do XSL-Transformation on content contained in package
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OdfXMLHelper

public OdfXMLHelper()
Method Detail

createXMLReader

public XMLReader createXMLReader(OdfPackage pkg)
                          throws SAXException,
                                 ParserConfigurationException
create an XMLReader with a Resolver set to parse content in a ODF Package

Parameters:
pkg - - the ODF Package
Returns:
a SAX XMLReader
Throws:
SAXException
ParserConfigurationException

parse

public void parse(OdfPackage pkg,
                  String path,
                  ContentHandler contentHandler,
                  ErrorHandler errorHandler)
           throws SAXException,
                  ParserConfigurationException,
                  IOException,
                  IllegalArgumentException,
                  TransformerConfigurationException,
                  TransformerException
use SAX parser to parse content of package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
contentHandler - - a SAX Content handler to receive SAX Events
errorHandler - - a SAX Error handler to be called on errors during parsing
Throws:
SAXException
ParserConfigurationException
IOException
IllegalArgumentException
TransformerConfigurationException
TransformerException

transform

public void transform(OdfPackage pkg,
                      String path,
                      String templatePath,
                      String outPath)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templatePath - - a path to a file in the filesystem containing an XSL Template
outPath - - a path in the filesystem for the output of the XSL Transformation
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      Source templateSource,
                      String outPath)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templateSource - - TraX Source of an XSL Transformation Template
outPath - - path to an output file for the XSL Transformation
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      Source templateSource,
                      File out)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templateSource - - TraX Source of an XSL Transformation
out - - an output File
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      String templatePath)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package insert result back to package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templatePath - - path inside the filesystem to an XSL template file
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      File template,
                      File out)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
template - - File containing an XSLT Template
out - - File for the XSLT ouput
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      File template)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package insert result back to package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
template - - a File containing an XSLT Template
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      Source templateSource,
                      Result result)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templateSource - - TraX Source of an XSLT Template
result - - TraX Result of XSL-Tranformation
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      Templates templates,
                      Result result)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templates - - TraX XSLT Template
result - - TraX XSLT Result
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException

transform

public void transform(OdfPackage pkg,
                      String path,
                      Templates templates)
               throws TransformerConfigurationException,
                      TransformerException,
                      IOException,
                      IllegalArgumentException,
                      SAXException,
                      ParserConfigurationException
Do XSL-Transformation on content contained in package and insert result back to package

Parameters:
pkg - - a OdfPackage
path - - a path inside the OdfPackage, eg. to a contained content.xml stream
templates - - Trax XSLT Template
Throws:
TransformerConfigurationException
TransformerException
IOException
IllegalArgumentException
SAXException
ParserConfigurationException


Copyright © 2009. All Rights Reserved.