MSXML 中的 XPath 查询是否有最大长度?
我计划使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有遇到任何这样的限制,并且我怀疑在运行查询的剪切成本使其变得不可行之前您是否可以达到任何限制。
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.