diff artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java @ 25:ccc6aae25585

Moved some XPath stuff from Config into XMLUtils. artifacts/trunk@59 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 10 Sep 2009 09:23:53 +0000
parents 00596a591a2f
children c2fc85e55f9f
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java	Thu Sep 10 08:57:09 2009 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java	Thu Sep 10 09:23:53 2009 +0000
@@ -10,12 +10,10 @@
 import org.xml.sax.SAXException;
 
 import javax.xml.parsers.DocumentBuilderFactory;
-
 import javax.xml.parsers.ParserConfigurationException;
 
 import javax.xml.namespace.QName;
 
-import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathConstants;
 
 import org.apache.log4j.Logger;
@@ -95,22 +93,11 @@
     public static final Object getXPath(
         Object root, String query, QName returnType
     ) {
-        if (root == null) {
-            return null;
-        }
-
-        try {
-            return XMLUtils.newXPath().evaluate(query, root, returnType);
-        }
-        catch (XPathExpressionException xpee) {
-            logger.error(xpee.getLocalizedMessage(), xpee);
-        }
-
-        return null;
+        return XMLUtils.xpath(root, query, returnType);
     }
 
     public static final Object getXPath(String query, QName returnType) {
-        return getXPath(getConfig(), query, returnType);
+        return XMLUtils.xpath(getConfig(), query, returnType);
     }
 
     public static final NodeList getNodeSetXPath(String query) {

http://dive4elements.wald.intevation.org