寻找一个通过 X-Path 读取和查询大型 XML 文件的工具

发布于 2025-01-08 09:41:40 字数 1539 浏览 0 评论 0原文

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

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

发布评论

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

评论(7

赠佳期 2025-01-15 09:41:40

First Object 也满足第二个条件,但方式很棘手。
您必须右键单击 xml 文件窗口中的 xml 表达式,然后在上下文菜单中选择“生成程序”/“收集唯一值”。 FOAL 程序在另一个窗口中生成,在这个窗口中您必须使用 F9 或“运行”上下文菜单项运行,选择 xml 文件,最后,您将获得输出!

First Object meets the second criteria also but in a tricky way.
You have to right click the xml expression in xml file window and in the context menu select "Generate Program"/"Gather Unique Values" . The FOAL program is generated in another window and in this you have to run in with F9 or the "Run" context menu item, select the xml file and, finally, you have the output !

听闻余生 2025-01-15 09:41:40

我不知道它处理大文件的效果如何,但是 XML Notepad 具有一些 XPath 功能。

I don't know how well it works with large files, but XML Notepad has some XPath capability.

心清如水 2025-01-15 09:41:40

您可以使用此XML XPath Visualizer 工具

我正在使用它,它看起来不错,而且是一个轻量级的 Windows 应用程序。

You can use this XML XPath Visualizer Tool.

I am using it and it's seems nice and it's a light weight application for Windows.

丢了幸福的猪 2025-01-15 09:41:40

Altova XmlSpy 是一个非常强大的工具,它具有支持 XPath。它具有 XPath 自动完成功能,并在您键入 XPath 查询时显示结果节点集。

Altova XmlSpy is a very powerful tool which has support for XPath. It has XPath auto-completion and shows resulting node set at the time when you are typing your XPath query.

怂人 2025-01-15 09:41:40

传统的 xpath 引擎从 XML 创建 DOM,并在该 DOM 上评估 xpath。为 50MB 的 xml 文件创建 DOM 需要大量内存。

您可以尝试 XMLDog。它在大型 xml 文件上评估 xpath,而不创建 DOM,因此需要很少的内存。它附带了一个命令行工具 xmldog.bat。

它是用java实现的。这样你就可以在windows上使用它

Traditional xpath engines create DOM from XML and evaluate xpath on that DOM. Creating DOM for 50MB xml files requires lot of memory.

You can try XMLDog. it evaluates xpath on large xml files without creating DOM, thus requires little memory. It comes with a command line tool xmldog.bat.

It is implemented in java. So you can use it on windows

故事还在继续 2025-01-15 09:41:40

50Mb 很大,但完全在 Saxon 的容量之内。很大程度上取决于您如何使用 XPath:例如,您是否想要对同一文档运行多个 XPath 查询?在这种情况下,您几乎肯定希望该文档位于内存中。在 Saxon 中,大约需要 250Mb,这在大多数现代机器上都是可用的。如果您希望每次运行 XPath 表达式时都从磁盘解析 XML,那么可能有处理器可以做到这一点(至少对于 XPath 的子集),但解析成本可能会很高。正如经常发生的那样,更快的速度会消耗更多的内存。

50Mb is large, but well within the capacity of (say) Saxon. A lot depends on how you are using XPath: do you want to run more than one XPath query against the same document, for example? In that case, you almost certainly want the document in memory. In Saxon that will take about 250Mb, which is readily available on most modern machines. If you want to parse the XML from disk each time you run an XPath expression, then there may be processors that can do that (at least for a subset of XPath), but the parsing cost is likely to be high. As often happens, faster speed will cost more memory.

断念 2025-01-15 09:41:40

我之前使用过 xmlstarlet,它使我能够编写整个过程的脚本。希望找到更新的解决方案来解决问题,但这是我迄今为止看到的列表中最好的。

I've used xmlstarlet before which enabled me to script the entire process. Was hoping to find newer solutions to the problem, but this is the best of the list I see so far.

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