edu.ucsb.nceas.metacat
Class DBTransform

java.lang.Object
  extended byedu.ucsb.nceas.metacat.DBTransform

public class DBTransform
extends java.lang.Object

A Class that transforms XML documents utitlizing XSL style sheets


Constructor Summary
DBTransform()
          construct a DBTransform instance.
 
Method Summary
static org.w3c.dom.NodeList getPathContent(java.io.File f, java.lang.String path)
          gets the content of a tag in a given xml file with the given path
 java.lang.String getStyleSystemId(java.lang.String qformat, java.lang.String sourcetype, java.lang.String targettype)
          Lookup a stylesheet reference from the db catalog
static void main(java.lang.String[] args)
          the main routine used to test the transform utility.
 void transformXMLDocument(java.io.StringReader docContent, java.lang.String sourceType, java.lang.String targetType, java.lang.String qformat, java.io.PrintWriter pw, java.util.Hashtable param, java.lang.String sessionid)
          Method to do transform for a string reader
 void transformXMLDocument(java.lang.String doc, java.lang.String sourceType, java.lang.String targetType, java.lang.String qformat, java.io.PrintWriter pw, java.util.Hashtable param)
           
 void transformXMLDocument(java.lang.String doc, java.lang.String sourceType, java.lang.String targetType, java.lang.String qformat, java.io.PrintWriter pw, java.util.Hashtable param, java.lang.String sessionid)
          Transform an XML document using the stylesheet reference from the db
 void transformXMLDocument(java.lang.String doc, java.lang.String sourceType, java.lang.String targetType, java.lang.String qFormat, java.io.StringWriter pw)
           
 void transformXMLDocument(java.lang.String doc, java.lang.String sourceType, java.lang.String targetType, java.lang.String qFormat, java.io.StringWriter pw, java.lang.String sessionid)
          Transform an XML document to StringWriter using the stylesheet reference from the db
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTransform

public DBTransform()
            throws java.io.IOException,
                   java.sql.SQLException,
                   java.lang.ClassNotFoundException
construct a DBTransform instance. Generally, one calls transformXMLDocument() after constructing the instance

Method Detail

transformXMLDocument

public void transformXMLDocument(java.lang.String doc,
                                 java.lang.String sourceType,
                                 java.lang.String targetType,
                                 java.lang.String qformat,
                                 java.io.PrintWriter pw,
                                 java.util.Hashtable param)
See Also:
transformXMLDocument(String doc, String sourceType, String targetType, String qformat, PrintWriter pw, String sessionid)

transformXMLDocument

public void transformXMLDocument(java.lang.String doc,
                                 java.lang.String sourceType,
                                 java.lang.String targetType,
                                 java.lang.String qFormat,
                                 java.io.StringWriter pw)
See Also:
transformXMLDocument(String doc, String sourceType, String targetType, String qFormat, StringWriter pw String sessionid)

transformXMLDocument

public void transformXMLDocument(java.lang.String doc,
                                 java.lang.String sourceType,
                                 java.lang.String targetType,
                                 java.lang.String qformat,
                                 java.io.PrintWriter pw,
                                 java.util.Hashtable param,
                                 java.lang.String sessionid)
Transform an XML document using the stylesheet reference from the db

Parameters:
doc - the document to be transformed
qformat - the name of the style set to use
pw - the PrintWriter to which output is printed

transformXMLDocument

public void transformXMLDocument(java.lang.String doc,
                                 java.lang.String sourceType,
                                 java.lang.String targetType,
                                 java.lang.String qFormat,
                                 java.io.StringWriter pw,
                                 java.lang.String sessionid)
Transform an XML document to StringWriter using the stylesheet reference from the db

Parameters:
doc - the document to be transformed
sourceType - the document type of the source
targetType - the target document type
qFormat - the name of the style set to use
pw - the StringWriter to which output will be stored

transformXMLDocument

public void transformXMLDocument(java.io.StringReader docContent,
                                 java.lang.String sourceType,
                                 java.lang.String targetType,
                                 java.lang.String qformat,
                                 java.io.PrintWriter pw,
                                 java.util.Hashtable param,
                                 java.lang.String sessionid)
Method to do transform for a string reader

Parameters:
qformat - the name of the style set to use
pw - the PrintWriter to which output is printed

getPathContent

public static org.w3c.dom.NodeList getPathContent(java.io.File f,
                                                  java.lang.String path)
gets the content of a tag in a given xml file with the given path

Parameters:
f - the file to parse
path - the path to get the content from

getStyleSystemId

public java.lang.String getStyleSystemId(java.lang.String qformat,
                                         java.lang.String sourcetype,
                                         java.lang.String targettype)
Lookup a stylesheet reference from the db catalog

Parameters:
qformat - the named style-set format
sourcetype - the document type of the source
targettype - the document type of the target

main

public static void main(java.lang.String[] args)
the main routine used to test the transform utility. Usage: java DBTransform



Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.