【发布时间】:2018-09-14 10:25:12
【问题描述】:
我想提取以下xml的“输出元素”(-->http://Customer_LIB/bo/getCustomer/v1)的命名空间:
<?xml version="1.0" encoding="UTF-8"?>
<result xsi:type="cu:getCustomerResponseMsg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cu="wsdl.http://Customer_LIB/Customer" xmlns:cu_1="http://Customer_LIB/Customer" xmlns:v1="http://Customer_LIB/bo/getCustomer/v1">
<cu_1:getCustomerResponse>
<output xsi:type="v1:GetCustomerResponse">
<firstName>Hans</firstName>
<lastName>Moser</lastName>
</output>
</cu_1:getCustomerResponse>
</result>
有没有人有想法。我已经尝试过多种表达方式。请考虑我只能使用 Xpath 1.0 进行提取。非常感谢。
使用 xpath 1.0 表达式来检查 xml 中是否使用了命名空间“http://Customer_LIB/bo/getCustomer/v1”也足够了。
【问题讨论】: