MSXML 中的 XPath 查询是否有最大长度?

发布于 2024-07-13 19:45:37 字数 353 浏览 5 评论 0原文

我计划使用 msxml 进行相对较大的 XPath 查询。 msxml 强制执行的查询是否有最大长度限制?

背景:根据一些外部输入,我的代码将创建许多 xpath 查询,我对所有这些或运算的结果感兴趣:

   myObject.SelectNodes(subQuery1 +"|"+ subQuery2 +"|" + subQuery3 + "|" + ...)

我什至不知道编译时会有多少子查询,所以我可以' 预测查询字符串将会有多长。

我宁愿避免为每个子查询多次调用 SelectNodes,因为我担心性能会变差(COM 封送开销到 MSXML、处理多个结果树而不是单个树等)

I'm planning to do a relatively large XPath query using msxml. Is there a maximum length for a query that msxml enforces?

Background: From some external input my code will create a number of xpath-queries and I am interested in the result of all those or-ed together:

   myObject.SelectNodes(subQuery1 +"|"+ subQuery2 +"|" + subQuery3 + "|" + ...)

I even don't know how many subqueries there will be at compile time, so I can' predict how long the query string will get.

I'd rather avoid calling SelectNodes multiple times for each subquery for I fear performance to be worse (COM Marshaling Overhead into MSXML, handling of several result trees as opposed to a single tree, etc.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

涫野音 2024-07-20 19:45:37

我还没有遇到任何这样的限制,并且我怀疑在运行查询的剪切成本使其变得不可行之前您是否可以达到任何限制。

I've not come across any such limit and I doubt you could reach any limit before the shear cost of running the query would make it unfeasable anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文