domparser
Class DOMObject

java.lang.Object
  |
  +--domparser.DOMObject

public class DOMObject
extends java.lang.Object

Evokes the Xerces DOM parser on an XML file, returning and storing a DocumentObject tree representation of it.

Version:
1.0
Author:
David Kong, Queen's University, August 2002.

Constructor Summary
DOMObject(java.lang.String xmlFile)
          Constructor.
 
Method Summary
 void EvaluateAttributes(org.w3c.dom.NamedNodeMap NodeMap, DocumentObject doc)
          This method Evaluates the attributes in a given node and adds the corresponding AttributeValue objects to a given DocumentObject's AttributeList.
 DocumentObject EvaluateNode(org.w3c.dom.Node theNode, DocumentObject doc)
          Evaluates a Document node and creates a corresponding DocumentObject to add to an existing DocumentObject tree.
 DocumentObject getTree()
          Returns the DocumentObject tree representation of the XML file.
 void listAttributes(AttributeList list)
          For debugging purposes, will list the attributes in an AttributeList.
 void listTree(DocumentObject[] tree)
          For debugging purposes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMObject

public DOMObject(java.lang.String xmlFile)
          throws java.lang.Exception

Constructor.

Takes the xmlfile, parses it into a DOM Document, then converts the DOM Document into the corresponding DocumentObject tree. Stores the DocumentObject tree.

Parameters:
xmlFile - The XML file to process/convert.
Throws:
java.lang.Exception -  
Method Detail

getTree

public DocumentObject getTree()

Returns the DocumentObject tree representation of the XML file.


listAttributes

public void listAttributes(AttributeList list)
                    throws java.lang.Exception

For debugging purposes, will list the attributes in an AttributeList.

Parameters:
list - The attribute list to display.
Throws:
java.lang.Exception -  

listTree

public void listTree(DocumentObject[] tree)
              throws HL7Exception

For debugging purposes. Lists the objects in a DocumentObject tree.

Parameters:
tree - The DocumentObject tree to display.
Throws:
HL7Exception -  

EvaluateNode

public DocumentObject EvaluateNode(org.w3c.dom.Node theNode,
                                   DocumentObject doc)
                            throws java.lang.Exception

Evaluates a Document node and creates a corresponding DocumentObject to add to an existing DocumentObject tree.

Parameters:
theNode - The DOM object Node to evaluate
doc - The The existing DocumentObject tree to add this node to.
Throws:
java.lang.Exception -  

EvaluateAttributes

public void EvaluateAttributes(org.w3c.dom.NamedNodeMap NodeMap,
                               DocumentObject doc)
                        throws java.lang.Exception

This method Evaluates the attributes in a given node and adds the corresponding AttributeValue objects to a given DocumentObject's AttributeList.

Parameters:
NodeMap - The DOM NodeMap holding the attributes we want to convert.
doc - The DocumentObject that will hold the AttributeValue objects created.
Throws:
java.lang.Exception -