it.unipd.dei.ims.nestor.experiment.xml
Class GeneralDom

java.lang.Object
  extended by it.unipd.dei.ims.nestor.experiment.xml.GeneralDom

public class GeneralDom
extends java.lang.Object

This class allows for determining the XPath to a specific node.

Author:
silvello

Constructor Summary
GeneralDom()
           
 
Method Summary
static org.w3c.dom.Document getDom(java.io.File xmlFile)
           
static java.lang.String getMaxDepthLeafPath(org.w3c.dom.Document xmlDocument, java.lang.String rootElement)
          Returns the XPath to a leaf with maximum depth in the XMl file.
static java.lang.String getMaxFanOutPath(org.w3c.dom.Document xmlDocument)
          Returns the XPath to the max fan out node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralDom

public GeneralDom()
Method Detail

getDom

public static org.w3c.dom.Document getDom(java.io.File xmlFile)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException,
                                          javax.xml.parsers.ParserConfigurationException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

getMaxFanOutPath

public static java.lang.String getMaxFanOutPath(org.w3c.dom.Document xmlDocument)
Returns the XPath to the max fan out node

Parameters:
xmlDocument - the DOM of the XML file.
Returns:
the path to the max fan out node.

getMaxDepthLeafPath

public static java.lang.String getMaxDepthLeafPath(org.w3c.dom.Document xmlDocument,
                                                   java.lang.String rootElement)
                                            throws javax.xml.xpath.XPathExpressionException
Returns the XPath to a leaf with maximum depth in the XMl file.

Parameters:
xmlDocument - the DOM of the XML file.
rootElement - the root element of the XMl file to process; e.g. ead or site for XMark.
Returns:
the path to the max fan out node.
Throws:
javax.xml.xpath.XPathExpressionException