xpath - 无法使用 xPath 和命名空间提取 SOAPUI 属性传输中的值
问题描述
我尝试在使用 xPath的Property Transfer中从 xml 中提取值:
declare namespace S="http://www.w3.org/2003/05/soap-envelope"
declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"
/S:Envelope/S:Body/ns7:Document/ns7:QueryIPR/ns7:IPIList/ns7:PI/ns7:PI/ns7:cId/
我得到错误:
cId [net.sf.saxon.trans.XPathException: Required item type of first operand of '/' is node(); supplied value has item type xs:string]
我将传输源设置为上一步(返回有效 XML)、属性Response和路径语言XPath
不知道如何在 SoapUI 中修复它(在纯 java 中更容易)
解决方案
好的,我的错误在第二行我有:
declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"
如果您使用纯 XML,则可以设置属性。但在 SoapUI 中应该是:
declare namespace ns7="http://schemas.BIGBANK.pl/"
现在它工作正常。
推荐阅读
- javascript - 如何在 VueJS 中发出事件?
- flutter - 在 null 上调用了方法“[]”
- iterm2 - 如何摆脱 iterm 上这种非常丑陋的突出显示?
- c++ - 将 CV_32FC1 转换为 CV_16UC1
- yaml - 每个 bash 步骤是否都会创建一个新的 shell 环境?
- nginx - 如何在 nginx 中选择解析器?
- java - OpenGL Compute Shader 未在笔记本电脑上链接
- reactjs - 增量更新状态数组,而不是完全更新
- c++ - 在 C++ 中组合字符串以重命名文件以显示日期
- python - 用于文本分类的 SkLearn 模型