给定 XML:
<?xml version="1.0" encoding="UTF-8"?>
<sensor-system>
<velocity>120.00</velocity> <!-- km/h -->
<temperature location="inside">24.6</temperature>
<temperature location="outside">-12.5</temperature>
<seats>
<seat location="front">
<id>1</id>
<temperature>32.5</temperature>
<heating-is-on/>
</seat>
<seat location="back">
<id>2</id>
<temperature>23.5</temperature>
</seat>
</seats>
</sensor-system>
所需的 XML 路径:
给出一个绝对 XPATH,它标识所有前排座椅的温度大于或等于 20.0 且小于或等于 30.0 摄氏度。
我的解决方案请检查:
这个对吗 :
/sensor-system/seats[temperature>=20 | temperature <=30]/seat[@location="front"]
谢谢你。