流XPath评估 [英] Streaming XPath evaluation

查看:108
本文介绍了流XPath评估的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何可用于生成的库用于根据提供的xml文档进行流式化XPath表达式评估?我的调查显示,大多数现有解决方案在评估xpath表达式之前将整个DOM树加载到内存中。

解决方案

一个完整的XPath实现,由于XPath语法允许:

  / AAA / XXX / following :: * 

  AAA / BBB / follow-sibling :: * 

这意味着先行要求?即从一个特定的节点,你将不得不加载文档的其余部分。



Nux 库(具体来说, StreamingPathFilter )提出了这一点,并引用了依赖于XPath的子集的一些实现。 Nux声称执行一些流式查询功能,但鉴于上述情况,XPath实现将会有一些限制。


Are there any production-ready libraries for streaming XPath expressions evaluation against provided xml-document? My investigations show that most of existing solutions load entire DOM-tree into memory before evaluating xpath expression.

解决方案

Would this be practical for a complete XPath implementation, given that XPath syntax allows for:

/AAA/XXX/following::*

and

/AAA/BBB/following-sibling::*

which implies look-ahead requirements ? i.e. from a particular node you're going to have to load the rest of the document anyway.

The doc for the Nux library (specifically StreamingPathFilter) makes this point, and references some implementations that rely on a subset of XPath. Nux claims to perform some streaming query capability, but given the above there will be some limitations in terms of XPath implementation.

这篇关于流XPath评估的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆