xpath - Xpath 多重格式化输出
问题描述
xml
在一个文件中有很多条目并且xpath
有条件:
/XMLReport/Report/PreflightResult/PreflightResultEntry[
@type = 'Check' and @level = 'warning']/PreflightResultEntryMessage/Message/text()
输出是:
onetwothreefour... and more
我需要分离
'---' one---two---three---four
或者
[enter]
one
two
three
four
这是可能的 ?
解决方案
为什么将 XPath 表达式绑定在单引号内'
:
用这个:
string-join(/XMLReport/Report/PreflightResult/PreflightResultEntry[@type = 'Check' and @level = 'warning']/PreflightResultEntryMessage/Message/text(), '---')
推荐阅读
- php - symfony 桥将 phpunit 安装到 bin 目录
- amazon-web-services - AWS Route53 托管区域 ID 的 Reg exp?
- extjs - Ext js 问题 - 无法通过扩展模型来继承“has-many”
- php - 从 PHP 调用简单的 Golang 可执行文件失败并出现 exec:“zip”:在 $PATH 中找不到可执行文件
- apache-nifi - 使用 Apache Nifi 在 CSV 中转换日期格式
- reactjs - React - 状态变量不反映变化
- regex - 在 Flutter/Dart 中用于简单数学计算的输入格式化程序正则表达式
- visual-studio - Visual Studio - 将每个新项目的“将警告视为错误”更改为全部
- python - 为什么这些循环输出不同?
- javascript - 如何在 p5.js 中为 loadimage() 使用本地服务器?