我是机器人框架的 XML 库的新手。我尝试解析 xml 以获取其中的值,但它只会获取第一个元素。所以我的 XML 是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<firstElement>
<secondElement>
<myValue>...</myValue>
<mySecondValue>...</mySecondValue>
...
</secondElement
</firstElement>
</S:Header>
<S:Body>
...
</S:Body>
</S:Envelope>
我非常简短的机器人框架测试如下所示:
${xml}= Parse Xml path/to/xml
${first}= get element ${xml} myValue
Log ${first}
但是在解析 XML 时,它会像这样记录它:
INFO : ${xml} = <Element 'Envelope' at 0x00000000042B67C8>
当然,我在解析的 xml 中获取值的所有尝试都失败了,我得到:
FAIL : No element matching 'myValue' found.
我做错了什么?