XDC - v. 0.6.1

net.sf.xdc.util
Class XslUtils

java.lang.Object
  extended bynet.sf.xdc.util.XslUtils

public class XslUtils
extends java.lang.Object

This is a utility class containg various method related to XSLT transformations.

Since:
0.5
Version:
0.5
Author:
Jens Voß

Method Summary
static org.w3c.dom.Document transform(org.w3c.dom.Document xml, java.lang.String xslResourceName, java.util.Map tables)
          This method attempts to transform an XML structure contained in a DOM Document using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a DOM Document.
static org.w3c.dom.Document transform(java.lang.String xmlFileName, java.nio.charset.Charset charset, java.lang.String xslResourceName, java.util.Map tables)
          This method attempts to transform an XML structure contained in a file using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a DOM Document.
static java.lang.String transformToString(java.lang.String xmlFileName, java.lang.String xslResourceName, java.util.Map tables)
          This method attempts to transform an XML structure contained in a file using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transform

public static org.w3c.dom.Document transform(java.lang.String xmlFileName,
                                             java.nio.charset.Charset charset,
                                             java.lang.String xslResourceName,
                                             java.util.Map tables)
                                      throws XmlException
This method attempts to transform an XML structure contained in a file using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a DOM Document.

Parameters:
xmlFileName - The path (in the file system) of the XML input file
charset - The file encoding charset
xslResourceName - The name of the XSLT stylesheet resource; either the name by which the resource is accessed by the Classloader or any valid URL
tables - Optional key-value pairs passed as stylesheet parameters to the transformer
Returns:
An XML document which is the result of the transformation
Throws:
XmlException

transform

public static org.w3c.dom.Document transform(org.w3c.dom.Document xml,
                                             java.lang.String xslResourceName,
                                             java.util.Map tables)
                                      throws XmlException
This method attempts to transform an XML structure contained in a DOM Document using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a DOM Document.

Parameters:
xml - The DOM document used as XML input
xslResourceName - The name of the XSLT stylesheet resource; either the name by which the resource is accessed by the Classloader or any valid URL
tables - Optional key-value pairs passed as stylesheet parameters to the transformer
Returns:
An XML document which is the result of the transformation
Throws:
XmlException

transformToString

public static java.lang.String transformToString(java.lang.String xmlFileName,
                                                 java.lang.String xslResourceName,
                                                 java.util.Map tables)
                                          throws XmlException
This method attempts to transform an XML structure contained in a file using an XSLT stylesheet contained in a resource (which can be loaded by the Classloader of this class) into a String.

Parameters:
xmlFileName - The path (in the file system) of the XML input file
xslResourceName - The name of the XSLT stylesheet resource; either the name by which the resource is accessed by the Classloader or any valid URL
tables - Optional key-value pairs passed as stylesheet parameters to the transformer
Returns:
A String containing the XML document which is the result of the transformation
Throws:
XmlException

XDC - v. 0.6.1