| java.lang.Object org.cougaar.lib.vishnu.client.VishnuDomUtil
VishnuDomUtil | public class VishnuDomUtil (Code) | | A collection of helper methods for manipulating DOM documents.
|
showTiming | boolean showTiming(Code) | | |
appendChildrenToDoc | protected void appendChildrenToDoc(Document originalDoc, Element originalAppendLoc, String filename)(Code) | | appends the document at filename onto originalDoc.
Parameters: originalDoc - - doc to append the filename doc to Parameters: filename - - name of the document to append |
appendDoc | protected void appendDoc(Document originalDoc, String filename)(Code) | | appends the document at filename onto originalDoc.
Parameters: originalDoc - - doc to append the filename doc to Parameters: filename - - name of the document to append |
appendDoc | protected void appendDoc(Document originalDoc, Element originalAppendLoc, String filename)(Code) | | appends the document at filename onto originalDoc.
Parameters: originalDoc - - doc to append the filename doc to Parameters: filename - - name of the document to append |
createClone | protected Node createClone(Node toClone, Document doc)(Code) | | Clone a node (only its attributes)
Parameters: toClone - - the node to copy Parameters: doc - - is the factory for new nodes the clone |
getDocAsString | protected String getDocAsString(Document doc)(Code) | | Makes a human-readable String representation of a dom document
Uses XMLSerializer to do its work.
See Also: org.apache.xml.serialize.XMLSerializer Parameters: doc - the document to translate into a String String readable document equivalent |
localSetup | protected void localSetup()(Code) | | sets showTiming parameter
|
merge | protected void merge(Node placeToAdd, Node rootToAdd)(Code) | | Takes two nodes of xml documents and makes the rootToAdd
node as a child of the placeToAdd node.
On the first call, these two nodes are the roots of two
separate xml documents.
It recurses down the tree to be added.
Note that naively taking the root to be added and
adding it directly by doing appendChild doesn't work,
since all DOM Nodes have an "owner document," and all
nodes in a tree must have the same owner. Since the
rootToAdd node comes from a different document, you'll get
a "Wrong Document Err" when you try to do this.
So you have to create copies with the target document's
createElement method and add those.
BOZO : probably better way to do this!
Parameters: placeToAdd - - the root of the destination document Parameters: rootToAdd - - the root of the document to merge into the firstdoc |
reportTime | public void reportTime(String prefix, Date start)(Code) | | Prints out time since start with prefix prefix
Parameters: start - since when Parameters: prefix - meaning of time difference |
writeDocToStream | protected void writeDocToStream(Document doc, OutputStream os)(Code) | | write document to an output stream using XMLSerializer
|
|
|