com.plumtree.openfoundation.xml.xsl
Class XPXslTransform

java.lang.Object
  extended by com.plumtree.openfoundation.xml.xsl.XPXslTransform

public class XPXslTransform
extends java.lang.Object

Java XSL transform wrapper - designed against System.Xml.Xsl.XslTransform in c# .Net 1.1 api. Underlying objects are built against Xerces 1.4.4 and Xalan-J 2.5.0.

This class is not thread safe - multiple threads handling the same XPXslTransform will cause unexpected behavior.

Author:
Akash Jain

Constructor Summary
XPXslTransform()
          Empty constructor.
 
Method Summary
 java.lang.String GetXSLFilePath()
          Returns the path to the currently loaded XSL file.
 void Load(java.lang.String filePath)
          Loads an XSLT file to be used for transformation.
 void Transform(XPDocument xmlIn, XPHashtable args, XPStringBuilder dataOut)
          Given an XPDocument, we apply the loaded XSL file and return the result in the supplied XPStringBuilder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPXslTransform

public XPXslTransform()
Empty constructor.

Method Detail

Load

public void Load(java.lang.String filePath)
Loads an XSLT file to be used for transformation. It is strongly recommended that the XSLT file contain information about the output format, specifically the encoding attribute. For example: <xsl:output encoding="utf-8" method="xml" indent="yes"/> This method can be called multiple times with different filenames to use the same XPXslTransform object to do multiple transformations. (.NET behaviour).

Parameters:
filePath - String that is the full path to the XSLT file.

Transform

public void Transform(XPDocument xmlIn,
                      XPHashtable args,
                      XPStringBuilder dataOut)
Given an XPDocument, we apply the loaded XSL file and return the result in the supplied XPStringBuilder. If no file has been loaded, we do nothing.

Parameters:
xmlIn - XPDocument that we want to transform
args - argument list to pass to the transformer - name/value String/Object pairs
dataOut - StringBuilder to write the resulting transformation to

GetXSLFilePath

public java.lang.String GetXSLFilePath()
Returns the path to the currently loaded XSL file.

Returns:
a String with the path the currently loaded XSL file. Empty String if none has been loaded.


Copyright © 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.