xml - 如果 xml 文件中的字符串匹配,则获取文件名
问题描述
我正在尝试获取包含特定字符串的 xml 文件的文件名(包括路径)。
for $file in doc("allfiles.xml")/allfiles/doc,
$thefile in doc(concat("../data/", $file/@href)),
$profile in $here/there/header/profile[contains(., "thespecificstring")]
return
$getfilename
for 语句有效,但我需要在 return 中添加什么?我只是不了解文档。
解决方案
如果没有看到您的输入和所需的输出,很难说,但也许您想要document-uri($thefile)
.
推荐阅读
- mysql - sql分组计算
- php - 在不执行 setGroupBy 的情况下删除 sphinx 中的重复记录?
- vba - 编辑表格时在功能区中隐藏 MS Word“表格工具”
- amazon-web-services - 在 VM 与 Kubernetes 上设置 HA RabbitMQ 和 Redis ReJson 的最佳方法
- r - R中决策树中混淆矩阵中的缺失值
- java - 手动杀死应用程序时如何获取广播接收器?
- html - 带有图形背景的表单输入
- automated-tests - 在执行结束时将报告文件放在自定义文件夹中
- mongodb - Docker compose mongo 不会创建 root 用户
- r - 将儒略日数转换为日期时间格式 yyyy-mm-dd hh:mm:ss in R