org.mmbase.util
Class XSLTransformer

java.lang.Object
  |
  +--org.mmbase.util.XSLTransformer

public class XSLTransformer
extends java.lang.Object

Make XSL Transformations

Version:
$Id: XSLTransformer.java,v 1.12.2.2 2003/02/11 17:04:08 michiel Exp $
Author:
Case Roole, cjr@dds.nl, Michiel Meeuwissen

Constructor Summary
XSLTransformer()
          Empty constructor
 
Method Summary
static void main(java.lang.String[] argv)
          Invocation of the class from the commandline for testing/building
 void transform(javax.xml.transform.dom.DOMSource xml, java.io.File xslFile, javax.xml.transform.stream.StreamResult result, java.util.Map params)
          This is the base function which calls the actual XSL transformations.
 void transform(javax.xml.transform.dom.DOMSource xml, java.io.File xslFile, javax.xml.transform.stream.StreamResult result, java.util.Map params, boolean considerDir)
           
 void transform(java.io.File xmlDir, java.io.File xslFile, java.io.File resultDir, boolean recurse, java.util.Map params, boolean considerDir)
          Can be used to transform a directory of XML-files.
 void transform(java.io.File xmlFile, java.io.File xslFile, javax.xml.transform.stream.StreamResult result, java.util.Map params, boolean considerDir)
          Perfoms XSL Transformation on XML-file which is parsed MMBase specificly (useing MMBasse EntityResolver and Errorhandler).
 java.lang.String transform(java.lang.String xmlPath, java.lang.String xslPath)
          Transform an XML document using a certain XSL document.
 java.lang.String transform(java.lang.String xmlPath, java.lang.String xslPath, boolean cutXML)
          Transform an XML document using a certain XSL document, on MMBase specic way (error handling, entitity resolving, uri resolving, logging), and write it to string, which optionally can be 'cut'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTransformer

public XSLTransformer()
Empty constructor
Method Detail

transform

public java.lang.String transform(java.lang.String xmlPath,
                                  java.lang.String xslPath)
Transform an XML document using a certain XSL document.
Parameters:
xmlPath - Path to XML file
xslPath - Path to XSL file
Returns:
String with converted XML document

transform

public java.lang.String transform(java.lang.String xmlPath,
                                  java.lang.String xslPath,
                                  boolean cutXML)
Transform an XML document using a certain XSL document, on MMBase specic way (error handling, entitity resolving, uri resolving, logging), and write it to string, which optionally can be 'cut'.
Parameters:
xmlPath - Path to XML file
xslPath - Path to XSL file
cutXML - if true, cuts the <?xml> line that normally starts an xml document
Returns:
String with converted XML document

transform

public void transform(javax.xml.transform.dom.DOMSource xml,
                      java.io.File xslFile,
                      javax.xml.transform.stream.StreamResult result,
                      java.util.Map params)
               throws javax.xml.transform.TransformerException,
                      javax.xml.parsers.ParserConfigurationException,
                      java.io.IOException,
                      org.xml.sax.SAXException
This is the base function which calls the actual XSL transformations. Performs XSL transformation on MMBase specific way (using MMBase cache, and URIResolver).
Since:
MMBase-1.6

transform

public void transform(javax.xml.transform.dom.DOMSource xml,
                      java.io.File xslFile,
                      javax.xml.transform.stream.StreamResult result,
                      java.util.Map params,
                      boolean considerDir)
               throws javax.xml.transform.TransformerException,
                      javax.xml.parsers.ParserConfigurationException,
                      java.io.IOException,
                      org.xml.sax.SAXException

transform

public void transform(java.io.File xmlFile,
                      java.io.File xslFile,
                      javax.xml.transform.stream.StreamResult result,
                      java.util.Map params,
                      boolean considerDir)
               throws javax.xml.transform.TransformerException,
                      javax.xml.parsers.ParserConfigurationException,
                      java.io.IOException,
                      org.xml.sax.SAXException
Perfoms XSL Transformation on XML-file which is parsed MMBase specificly (useing MMBasse EntityResolver and Errorhandler).
Since:
MMBase-1.6

transform

public void transform(java.io.File xmlDir,
                      java.io.File xslFile,
                      java.io.File resultDir,
                      boolean recurse,
                      java.util.Map params,
                      boolean considerDir)
               throws javax.xml.transform.TransformerException,
                      javax.xml.parsers.ParserConfigurationException,
                      java.io.IOException,
                      org.xml.sax.SAXException
Can be used to transform a directory of XML-files. Of course the result must be written to files too. The transformations will be called with a paramter "root" which points back to the root directory relatively. You need this when all your transformations results (probably html's) need to refer to the same file which is relative to the root of the transformation.
Since:
MMBase-1.6

main

public static void main(java.lang.String[] argv)
Invocation of the class from the commandline for testing/building


MMBase build 1.6.5.20030923