跨 50 个 XML 文件查询的 XPath 函数? [英] XPath Function to query across 50 XML Files?

查看:64
本文介绍了跨 50 个 XML 文件查询的 XPath 函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位论坛成员,

我有 50 个 XML 文件,我需要能够对所有 50 个 XML 文件执行 XPath 查询.我正在使用 NotePad++XPath 评估器插件.我需要帮助编写查询所有 50 个 XML 文件的 XPath 表达式.所有 50 个 XML 文件都位于 C:\Root\Test\

I have 50 XML files and I need to be able to perform a XPath Query accross all 50 XML Files. I am using NotePad++ and an XPath Evaluator Plugin. I need help authoring a XPath expression that queries all 50 XML files. All 50 XML files are located in C:\Root\Test\

我需要的只是帮助找出在我的 XPath 表达式中使用的正确函数,以便它搜索位于 TEST 文件夹中的所有 XML 文件.我知道 NotePad++ 可以将所有文件作为一个组进行搜索.但是,我需要使用我的XPath Evaluator 插件来完成这项工作.任何帮助将不胜感激.

All I need is help in figuring out the correct function to use in my XPath expression so that it searches through all of the XML files located in the TEST folder. I know that NotePad++ can perform a search through all files as a group. However, I need to make this work using me XPath Evaluator plugin. Any help will be greatly appreciated.

先谢谢你.

推荐答案

您需要一个 XPath 2.0(或 XQuery 1.0)处理器来支持 collection() 函数并提供对目录的访问权限.

You need an XPath 2.0 (or XQuery 1.0) processor that supports the collection() function and gives access to directories.

下载 Saxon 并执行以下操作:

Download Saxon and do something like:

java net.sf.saxon.Query -qs:"collection('file:///Root/test?select=*.xml')//x[y='z']" 

这篇关于跨 50 个 XML 文件查询的 XPath 函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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