【发布时间】:2011-05-13 04:10:17
【问题描述】:
我需要在 GWT 中评估 XPath 查询。 我没有服务器端,所以我必须在我的 GWT 客户端应用程序中评估它们。
哪个是 GWT 的最佳 XPath 库?
【问题讨论】:
我需要在 GWT 中评估 XPath 查询。 我没有服务器端,所以我必须在我的 GWT 客户端应用程序中评估它们。
哪个是 GWT 的最佳 XPath 库?
【问题讨论】:
不知道它是否是最好的,或者它是否是你要找的,但快速搜索一下:http://dev.abiss.gr/sarissa/
【讨论】:
我找到了 totoe (http://code.google.com/p/totoe/),这是一个基于 Sarissa 的 GWT 库(谢谢 Diogo!)。它就像一个魅力!
例如:
String xml = "...";
Document document = new XmlParser().parse(xml, "xmlns:acme=\"http://www.acme.org\"");
Element root = document.getRoot();
List<Comment> comments = document.findByType(NodeType.COMMENT);
List<Node> products = document.selectNodes("//acme:products");
【讨论】: