org.apache.jetspeed.util
Class SimpleTransform

java.lang.Object
  extended byorg.apache.jetspeed.util.SimpleTransform

public class SimpleTransform
extends java.lang.Object

Provides a very simple mechanism to transform a document using XSLT using one XML document and another XSL document. This implementation uses the TRAX API. It can be used with any TRAX transformer. This can be used for very simple XML -> XSL processing to reduce the complexity and possibility of a runtime failure.

Version:
$Id: SimpleTransform.java,v 1.23 2004/02/23 03:23:42 jford Exp $
Author:
Kevin A. Burton, Santiago Gala

Constructor Summary
SimpleTransform()
           
 
Method Summary
static java.io.Reader SAXTransform(java.lang.String content_url, java.lang.String stylesheet_url, java.util.Map params)
          Perform a event based parsing of the given content_url, process it with the XSLT stylesheet stylesheet_url, using the params parameters, and return a Reader that will do the transformation dynamically.
static java.lang.String transform(org.w3c.dom.Document doc, java.lang.String stylesheet_url)
          Given a a DOM and a URL to a stylesheet, transform the original document.
static java.lang.String transform(org.w3c.dom.Document doc, java.lang.String stylesheet_url, java.util.Map params)
          Given a a DOM and a URL to a stylesheet, transform the original document, passing parameters to the stylesheet
static java.lang.String transform(org.xml.sax.InputSource content, org.xml.sax.InputSource stylesheet, java.util.Map params)
          Used internally to handle doing XSLT transformations directly.
static java.lang.String transform(java.lang.String url, java.lang.String stylesheet_url)
          Given a URL to an XML file and a URL to a stylesheet, transform the original document.
static java.lang.String transform(java.lang.String url, java.lang.String stylesheet_url, java.util.Map params)
          Given a URL to an XML file and a URL to a stylesheet, transform the original document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTransform

public SimpleTransform()
Method Detail

transform

public static java.lang.String transform(org.w3c.dom.Document doc,
                                         java.lang.String stylesheet_url)
                                  throws org.xml.sax.SAXException
Given a a DOM and a URL to a stylesheet, transform the original document.

Throws:
org.xml.sax.SAXException

transform

public static java.lang.String transform(org.w3c.dom.Document doc,
                                         java.lang.String stylesheet_url,
                                         java.util.Map params)
                                  throws org.xml.sax.SAXException
Given a a DOM and a URL to a stylesheet, transform the original document, passing parameters to the stylesheet

Throws:
org.xml.sax.SAXException

transform

public static java.lang.String transform(java.lang.String url,
                                         java.lang.String stylesheet_url)
                                  throws org.xml.sax.SAXException
Given a URL to an XML file and a URL to a stylesheet, transform the original document.

Throws:
org.xml.sax.SAXException

transform

public static java.lang.String transform(java.lang.String url,
                                         java.lang.String stylesheet_url,
                                         java.util.Map params)
                                  throws org.xml.sax.SAXException
Given a URL to an XML file and a URL to a stylesheet, transform the original document.

Throws:
org.xml.sax.SAXException

transform

public static java.lang.String transform(org.xml.sax.InputSource content,
                                         org.xml.sax.InputSource stylesheet,
                                         java.util.Map params)
                                  throws org.xml.sax.SAXException
Used internally to handle doing XSLT transformations directly.

Throws:
org.xml.sax.SAXException

SAXTransform

public static java.io.Reader SAXTransform(java.lang.String content_url,
                                          java.lang.String stylesheet_url,
                                          java.util.Map params)
                                   throws java.io.IOException
Perform a event based parsing of the given content_url, process it with the XSLT stylesheet stylesheet_url, using the params parameters, and return a Reader that will do the transformation dynamically.

Parameters:
content_url - The url of the xml document
stylesheet_url - The url of the stylesheet
params - A Map containing stylesheet parameters
Returns:
a Reader on the transformed document
Throws:
java.io.IOException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.