org.realtor.rets.util
Class XMLUtils

java.lang.Object
  |
  +--org.realtor.rets.util.XMLUtils

public class XMLUtils
extends java.lang.Object

Utilities for dealing with XML

Version:
1.0
Author:
tweber

Constructor Summary
XMLUtils()
           
 
Method Summary
static void addTextElement2Node(org.w3c.dom.Document doc, org.w3c.dom.Node rootNode, java.lang.String elementName, java.lang.String elementValue)
          Creates an Element and sets the text value of the element.
static void DOMtoOutputStream(org.w3c.dom.Document doc, java.io.OutputStream os)
          This method dumps out a dom document to an output stream.
static org.w3c.dom.NodeList executeXpathQuery(org.w3c.dom.Node root, java.lang.String query)
           
static void printNode(org.w3c.dom.Node node, java.lang.String indent)
           
static void printNodeList(org.w3c.dom.NodeList list)
           
static org.w3c.dom.Document stringToDocument(java.lang.String xml)
           
static void transformXml(java.lang.String xmlDoc, java.lang.String xslFile, java.io.OutputStream os)
           
static void transformXml(java.lang.String xmlDoc, java.lang.String xslFile, java.io.OutputStream os, java.util.Map parameters)
          Does an xsl tranformation of an XML document and writes the result.
static java.lang.String transformXmlToString(java.lang.String xmlDoc, java.lang.String xslFile)
           
static java.lang.String transformXmlToString(java.lang.String xmlDoc, java.lang.String xslFile, java.util.Map parameters)
          Does an xsl tranformation of an XML document and returns a String result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

DOMtoOutputStream

public static void DOMtoOutputStream(org.w3c.dom.Document doc,
                                     java.io.OutputStream os)
This method dumps out a dom document to an output stream. Header information is turned off.

Parameters:
doc - Dom Document
os - existing outputstream you wish to write the document to.

transformXmlToString

public static java.lang.String transformXmlToString(java.lang.String xmlDoc,
                                                    java.lang.String xslFile,
                                                    java.util.Map parameters)
Does an xsl tranformation of an XML document and returns a String result.

Parameters:
xmlDoc - string value of an xmlDocument
xslFile - filename of an XSL file.

transformXmlToString

public static java.lang.String transformXmlToString(java.lang.String xmlDoc,
                                                    java.lang.String xslFile)

transformXml

public static void transformXml(java.lang.String xmlDoc,
                                java.lang.String xslFile,
                                java.io.OutputStream os)

transformXml

public static void transformXml(java.lang.String xmlDoc,
                                java.lang.String xslFile,
                                java.io.OutputStream os,
                                java.util.Map parameters)
Does an xsl tranformation of an XML document and writes the result. to an output stream.

Parameters:
xmlDoc - string value of an xmlDocument
xslFile - filename of an XSL file.
os - OutputStream to write the results to.

addTextElement2Node

public static void addTextElement2Node(org.w3c.dom.Document doc,
                                       org.w3c.dom.Node rootNode,
                                       java.lang.String elementName,
                                       java.lang.String elementValue)
Creates an Element and sets the text value of the element. Appends the element to rootNode.

Parameters:
doc - DOM Document
rootNode - node to add an element to
elementName - name of the new element
elementValue - value of the new element.

executeXpathQuery

public static org.w3c.dom.NodeList executeXpathQuery(org.w3c.dom.Node root,
                                                     java.lang.String query)
                                              throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException

printNodeList

public static void printNodeList(org.w3c.dom.NodeList list)

printNode

public static void printNode(org.w3c.dom.Node node,
                             java.lang.String indent)

stringToDocument

public static org.w3c.dom.Document stringToDocument(java.lang.String xml)


Copyright © 2002 National Association of Realtors - All Rights Reserved.