dk.netarkivet.common.utils
Class XmlUtils

java.lang.Object
  extended by dk.netarkivet.common.utils.XmlUtils

public class XmlUtils
extends java.lang.Object

Utilities for handling XML-files.


Constructor Summary
XmlUtils()
           
 
Method Summary
static org.dom4j.Document getXmlDoc(java.io.File f)
          Read and parse an XML-file, and return a Document object representing this object.
static void setNode(org.dom4j.Document doc, java.lang.String xpath, java.lang.String value)
          Set a XmlNode defined by the given XPath to the given value.
 
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

getXmlDoc

public static org.dom4j.Document getXmlDoc(java.io.File f)
                                    throws IOFailure
Read and parse an XML-file, and return a Document object representing this object.

Parameters:
f - a given xml file
Returns:
a Document representing the xml-file
Throws:
IOFailure - if unable to read the xml-file or unable to parse the file as XML

setNode

public static void setNode(org.dom4j.Document doc,
                           java.lang.String xpath,
                           java.lang.String value)
Set a XmlNode defined by the given XPath to the given value.

Parameters:
doc - the Document, which is being modified
xpath - the given XPath
value - the given value