Skip to content

Commit

Permalink
Remove the broken Jaxen dependency (still need to rewrite play.libs.X…
Browse files Browse the repository at this point in the history
…Path without using it)
  • Loading branch information
guillaumebort committed Jul 30, 2012
1 parent b28b9b9 commit 77b960b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 30 deletions.
10 changes: 0 additions & 10 deletions framework/project/Build.scala
Expand Up @@ -255,16 +255,6 @@ object PlayBuild extends Build {
"javax.transaction" % "jta" % "1.1",
"tyrex" % "tyrex" % "1.0.1",

("jaxen" % "jaxen" % "1.1.3" notTransitive())
.exclude("maven-plugins", "maven-cobertura-plugin")
.exclude("maven-plugins", "maven-findbugs-plugin")
.exclude("dom4j", "dom4j")
.exclude("jdom", "jdom")
.exclude("xml-apis", "xml-apis")
.exclude("xerces", "xercesImpl")
.exclude("xom", "xom")
,

"net.sf.ehcache" % "ehcache-core" % "2.5.0",

"org.specs2" %% "specs2" % "1.9" % "test",
Expand Down
36 changes: 16 additions & 20 deletions framework/src/play/src/main/java/play/libs/XPath.java
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.Map;

import org.jaxen.dom.DOMXPath;
import javax.xml.xpath.*;
import org.w3c.dom.Node;
import org.w3c.dom.Text;

Expand All @@ -23,11 +23,12 @@ public class XPath {
*/
@SuppressWarnings("unchecked")
public static List<Node> selectNodes(String path, Object node, Map<String, String> namespaces) {
try {
/*try {
return getDOMXPath(path, namespaces).selectNodes(node);
} catch (Exception e) {
throw new RuntimeException(e);
}
}*/
return null;
}

/**
Expand All @@ -38,23 +39,26 @@ public static List<Node> selectNodes(String path, Object node, Map<String, Strin
* @return
*/
public static List<Node> selectNodes(String path, Object node) {
return selectNodes(path, node, null);
/*return selectNodes(path, node, null);*/
return null;
}

public static Node selectNode(String path, Object node, Map<String, String> namespaces) {
try {
/*try {
List<Node> nodes = selectNodes(path, node, namespaces);
if (nodes.size() == 0) {
return null;
}
return nodes.get(0);
} catch (Exception e) {
throw new RuntimeException(e);
}
}*/
return null;
}

public static Node selectNode(String path, Object node) {
return selectNode(path, node, null);
/*return selectNode(path, node, null);*/
return null;
}

/**
Expand All @@ -63,7 +67,7 @@ public static Node selectNode(String path, Object node) {
* @param node the node, node-set or Context object for evaluation. This value can be null.
*/
public static String selectText(String path, Object node, Map<String, String> namespaces) {
try {
/*try {
Node rnode = (Node) getDOMXPath(path, namespaces).selectSingleNode(node);
if (rnode == null) {
return null;
Expand All @@ -77,7 +81,8 @@ public static String selectText(String path, Object node, Map<String, String> na
return ((Text) rnode).getData();
} catch (Exception e) {
throw new RuntimeException(e);
}
}*/
return null;
}

/**
Expand All @@ -86,17 +91,8 @@ public static String selectText(String path, Object node, Map<String, String> na
* @param node the node, node-set or Context object for evaluation. This value can be null.
*/
public static String selectText(String path, Object node) {
return selectText(path, node, null);
}

private static DOMXPath getDOMXPath(String path, Map<String, String> namespaces) throws Exception {
DOMXPath xpath = new DOMXPath(path);
if (namespaces != null) {
for (String prefix: namespaces.keySet()) {
xpath.addNamespace(prefix, namespaces.get(prefix));
}
}
return xpath;
/*return selectText(path, node, null);*/
return null;
}

}

3 comments on commit 77b960b

@benmccann
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I got the Jaxen folks to check in a non-broken version of the pom file yesterday. Once they push it to the Maven central repo then Jaxen will not have its current problems. https://jira.codehaus.org/browse/JAXEN-220

@benmccann
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just emailed Don Corley asking if he could upload a new version of Jaxen to Maven.

@benmccann
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a new version of Jaxen released which fixes this issue: http://search.maven.org/remotecontent?filepath=jaxen/jaxen/1.1.4/jaxen-1.1.4.pom

Please sign in to comment.