-2
<devices>
<deviceType>PHONE</deviceType>
<account>717</accountId>
<attributes>
<value>New PHONE 1</value>
<key>FRIENDLY_NAME</key>
</attributes>
<attributes>
<value>TRUE</value>
<key>DOWNLOAD </key>
</attributes>
<attributes>
<value>1454737</value>
<key> TIMESTAMP</key>
</attributes>
<deviceId>550BDC49DA724C</deviceId>
</devices>
<devices>
<deviceType>WEB</deviceType>
<accountId>717</accountId>
<attributes>
<value>2016-04-11 08:53:52.866;</value>
<key>REGISTRATION </key>
</attributes>
<attributes>
<value>TRUE</value>
<key>ACTIVE_DEVICE</key>
</attributes>
<creationDate>146036872</creationDate>
<deviceId>997C6AADB51</deviceId>
</devices>
我需要獲取deviceId WHERE deviceType = PHONE,TABLET或WEB的值,並且此設備具有key = DOWNLOAD和value = TRUE的屬性。感謝您的XPath。具有更多條件的困難XPath
要OP:使用'正常化空間(鍵)'如果值o f'key'在你的實際XML中可能包含多餘的空白 – har07
謝謝,這只是一個錯誤 – Michal
謝謝,有沒有其他方式如何做到這一點? – Michal