net.objectlab.qalab.m2.util
Class XmlTransformer

java.lang.Object
  extended by net.objectlab.qalab.m2.util.XmlTransformer

public class XmlTransformer
extends java.lang.Object

A simple XML Transformer that is supplied with an XML file, an XSLT file and an output file.

Author:
Dave Sag.

Constructor Summary
XmlTransformer(java.io.InputStream anXml, java.io.InputStream anXslt, java.io.File anOutput)
          Constructor that takes the xml and xslt input stream and output file.
 
Method Summary
 void addParameter(java.lang.String aKey, java.lang.String aValue)
          Add an optional XSLT parameter.
 void transform()
          Performs the XSLT transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlTransformer

public XmlTransformer(java.io.InputStream anXml,
                      java.io.InputStream anXslt,
                      java.io.File anOutput)
Constructor that takes the xml and xslt input stream and output file.

Parameters:
anXml - The file containing well formed XML to be transformed.
anXslt - The file containing the XSLT that tranforms the XML.
anOutput - The file to write the outout to.
Method Detail

addParameter

public final void addParameter(java.lang.String aKey,
                               java.lang.String aValue)
Add an optional XSLT parameter.

Parameters:
aKey - The key. a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name.
aValue - The value.

transform

public final void transform()
                     throws javax.xml.transform.TransformerException
Performs the XSLT transformation.

Throws:
javax.xml.transform.TransformerException - if anything went wrong.


Copyright © 2005-2006 ObjectLab Financial Ltd. All Rights Reserved.