0
<NETCAST>
<ACTION NParam="7" ShortName="shot" Quarter="1" Position="27">
<PARAM Data="2" Name="Team"/>
<PARAM Data="2" Name="Player"/>
<PARAM Data="0" Name="Made"/>
<PARAM Data="2" Name="Points"/>
<PARAM Data="1" Name="AddFlags"/>
</ACTION>
<ACTION NParam="2" ShortName="assist" Quarter="1" Position="28">
<PARAM Data="2" Name="Team"/>
<PARAM Data="21" Name="Player"/>
</ACTION>
<ACTION NParam="7" ShortName="shot" Quarter="1" Position="29">
<PARAM Data="1" Name="Team"/>
<PARAM Data="21" Name="Player"/>
<PARAM Data="0" Name="Made"/>
<PARAM Data="3" Name="Points"/>
<PARAM Data="0" Name="AddFlags"/>
</ACTION>
<ACTION NParam="7" ShortName="shot" Quarter="1" Position="30">
<PARAM Data="2" Name="Team"/>
<PARAM Data="32" Name="Player"/>
<PARAM Data="0" Name="Made"/>
<PARAM Data="3" Name="Points"/>
<PARAM Data="4" Name="AddFlags"/>
</ACTION>
<ACTION NParam="3" ShortName="reb" Quarter="1" Position="31">
<PARAM Data="1" Name="Team"/>
<PARAM Data="-2" Name="Player"/>
<PARAM Data="1" Name="Type"/>
</ACTION>
<ACTION NParam="7" ShortName="shot" Quarter="1" Position="32">
<PARAM Data="1" Name="Team"/>
<PARAM Data="15" Name="Player"/>
<PARAM Data="1" Name="Made"/>
<PARAM Data="2" Name="Points"/>
<PARAM Data="3" Name="AddFlags"/>
</ACTION>
</NETCAST>
我需要,以便XPath查詢幫助選擇的XPath選擇子節點的屬性
ACTION /參數[@名稱=「點」] /數據(爲了待辦事項SUM)
凡
ACTION [NParam = 「7」] AND
ACTION/PARAM [@名稱= 「團隊」] [數據= 「1」] AND
ACTION/PARAM [@ Name =「Made」] [Data =「0」] AND
ACTION/PARAM [@ Name =「AddFlags」] [Data =「1」or「3」or「4」]
我知道如何選擇,但只使用一個孩子!
/NETCAST/ACTION[NParam=7]/PARAM[@Name="Points"]/@Data
在此先感謝您的幫助。
您建議的Xpath對於查詢是可以的,但是結果tha我需要得到的不是整個ACTION節點。對於上述結果,我只需要。使用你的答案+/PARAM [@ Name =「Points」],我明白了。感謝您的準確和快速響應。 –