使用Node.js遍历XML文档最快捷的方法?

从类似的问题,我发现了XPath ,它看起来非常快,但我不能用Node.js:

> var xp = new XPathEvaluator(); ReferenceError: XPathEvaluator is not defined at repl:1:14 at REPLServer.self.eval (repl.js:110:21) at repl.js:249:20 at REPLServer.self.eval (repl.js:122:7) at Interface.<anonymous> (repl.js:239:12) at Interface.EventEmitter.emit (events.js:95:17) at Interface._onLine (readline.js:202:10) at Interface._line (readline.js:531:8) at Interface._ttyWrite (readline.js:760:14) at ReadStream.onkeypress (readline.js:99:10) 

我可以以某种方式安装它作为一个模块? 还是有其他的select? 问题是我正在下载几个RSS提要总共约900条目。 我正在下载它们不到一秒钟,但用jQuery迭代每个元素

 $(xml).find('entry').each(function() { }); 

…需要10-15秒,这是一个Web服务是不能接受的。 有什么build议么?

如果您需要node.js,请首先打开http://npmjs.org ,看它是否已经存在。 对于像XPath遍历这样的常见事情,通常是这样。 在这种情况下: https : //npmjs.org/package/xpath