我有以下XML
输入XML文章源自玩技e族-https://www.playezu.com/180896.html
<?xml version="1.0" encoding="UTF-8"?>
<NAMESPACE:RAIseQuery xmlns:NAMESPACE="urn:NAMESPACE:xsd:$RAIseQuery" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:NAMESPACE:xsd:$RAIseQuery RAIseQuery.xsd">
<NAMESPACE:Sender>ABCDEF</NAMESPACE:Sender>
<NAMESPACE:Received>PQRSTUV</NAMESPACE:Received>
<NAMESPACE:Ref>ABC12345678</NAMESPACE:Ref>
<NAMESPACE:Waitforrevert xmlns="urn:xyz:std:xyz:2022:tech:xsd:abcd.123.001.01">
<START1>
<Id>PQRTSUV12345678910</Id>
</START1>
</NAMESPACE:Waitforrevert>
</NAMESPACE:RAIseQuery>
预期输出文章源自玩技e族-https://www.playezu.com/180896.html
<?xml version="1.0" encoding="UTF-8"?>
<NAMESPACE:RAIseQuery xmlns:NAMESPACE="urn:NAMESPACE:xsd:$RAIseQuery" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:NAMESPACE:xsd:$RAIseQuery RAIseQuery.xsd">
<NAMESPACE:Sender>ABCDEF</NAMESPACE:Sender>
<NAMESPACE:Received>PQRSTUV</NAMESPACE:Received>
<NAMESPACE:Ref>XYZ2345678</NAMESPACE:Ref>
<NAMESPACE:Waitforrevert xmlns="urn:xyz:std:xyz:2022:tech:xsd:abcd.123.001.01">
<START1>
<Id>DEFGSUV12345678910</Id>
</START1>
</NAMESPACE:Waitforrevert>
</NAMESPACE:RAIseQuery>
我试图为我的测试用例编辑XML,并在Robotframework中使用了以下内容。文章源自玩技e族-https://www.playezu.com/180896.html
*** Settings ***
Library XML use_lxml=yes
*** Test Cases ***
xml_with_namespace
${y}= Parse Xml ${IN_The_Path}
Set Element Text ${y} XYZ2345678 xpath=.//NAMESPACE:Ref
Set Element Text ${y} DEFGSUV12345678910xpath=.///NAMESPACE:Waitforrevert/START1/Id
Save Xml ${y} ${Path2}
但我得到以下错误。我不知道如何处理前缀和名称空间在径向基函数和新的使用这个库。文章源自玩技e族-https://www.playezu.com/180896.html
错误-语法错误:在前缀映射中找不到前缀“NAMESPACE”文章源自玩技e族-https://www.playezu.com/180896.html 文章源自玩技e族-https://www.playezu.com/180896.html
未知地区 1F
尝试以下Xpath:
xpath:/NAMESPACE:RAIseQuery/NAMESPACE:Ref 和
xpath:/NAMESPACE:RAIseQuery/NAMESPACE:Waitforrevert/START1/Id