com.bankframe.ei.txnhandler.dataformat.xml
Class XMLDataFormatHelper

java.lang.Object
  extended bycom.bankframe.ei.txnhandler.dataformat.xml.XMLDataFormatHelper

public class XMLDataFormatHelper
extends java.lang.Object

The XMLDataFormatHelper class provides the functionality for a user to transform an XML source using a style sheet.


Constructor Summary
XMLDataFormatHelper(java.io.File xmlFile)
          Constructor taking in a file.
XMLDataFormatHelper(java.lang.String xmlString)
          Constructor taking in an a String consisting of XML.
XMLDataFormatHelper(java.util.Vector dataPackets)
          Constructor taking in a vector of data packets.
 
Method Summary
static java.lang.String documentToString(org.w3c.dom.Document doc)
          This method converts a DOM Document to a String
 void format(java.lang.String xslSource, javax.xml.transform.Result result)
          This method applies the XSL to to XML source and outputs the result in the Result object.
static java.lang.String getFileContent(java.lang.String fileName)
          This method reads the contents of a file and returns it as a String.
 org.w3c.dom.Document getXmlDocument()
          Returns the xmlDocument.
 void setXmlDocument(org.w3c.dom.Document document)
          Sets the xmlDocument.
static org.w3c.dom.Document StringToDocument(java.lang.String string)
          This method converts a String to DOM Document
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDataFormatHelper

public XMLDataFormatHelper(java.util.Vector dataPackets)
                    throws ProcessingErrorException
Constructor taking in a vector of data packets.

Parameters:
dataPackets - the Vector of DataPackets
Throws:
ProcessingErrorException - if processing fails

XMLDataFormatHelper

public XMLDataFormatHelper(java.lang.String xmlString)
                    throws ProcessingErrorException
Constructor taking in an a String consisting of XML.

Parameters:
xmlString - the XML string
Throws:
ProcessingErrorException - if processing fails

XMLDataFormatHelper

public XMLDataFormatHelper(java.io.File xmlFile)
                    throws ProcessingErrorException
Constructor taking in a file.

Parameters:
xmlFile - the XML file
Throws:
ProcessingErrorException - if processing fails
Method Detail

format

public void format(java.lang.String xslSource,
                   javax.xml.transform.Result result)
            throws ProcessingErrorException
This method applies the XSL to to XML source and outputs the result in the Result object.

Parameters:
xslSource - String
result - the Result object where the tansformation is stored
Throws:
ProcessingErrorException - if processing fails

getFileContent

public static java.lang.String getFileContent(java.lang.String fileName)
                                       throws ProcessingErrorException
This method reads the contents of a file and returns it as a String.

Parameters:
fileName - the file from which to read
Returns:
String the file content
Throws:
ProcessingErrorException - if processing fails

getXmlDocument

public org.w3c.dom.Document getXmlDocument()
Returns the xmlDocument.

Returns:
Document

setXmlDocument

public void setXmlDocument(org.w3c.dom.Document document)
Sets the xmlDocument.

Parameters:
document - The document to set

documentToString

public static java.lang.String documentToString(org.w3c.dom.Document doc)
                                         throws ProcessingErrorException
This method converts a DOM Document to a String

Parameters:
doc - the Document object
Returns:
String the string representation of the document
Throws:
ProcessingErrorException - if processing fails

StringToDocument

public static org.w3c.dom.Document StringToDocument(java.lang.String string)
                                             throws ProcessingErrorException
This method converts a String to DOM Document

Parameters:
string - the XML String
Returns:
Document the Document object
Throws:
ProcessingErrorException - thrown if an error occurs during transformation


Copyright © 2005, 2007, Oracle. All rights reserved.