我已經看過一些在網絡上的例子,但我仍然在爲此而苦苦掙扎。 我想獲得的「indexDesc」標籤內,然後,顯示從「最後」標籤後的值「descShort」標籤的價值?我見過使用箭頭的人>但我仍然迷路。從jQuery獲取嵌套的XML項目
<indices>
<index>
<code>DJI</code>
<exchange>NYSE</exchange>
<liveness>DELAYED</liveness>
<indexDesc>
<desc>Dow Jones Industrials</desc>
<descAbbrev>DOW JONES</descAbbrev>
<descShort>DOW JONES</descShort>
<firstActive></firstActive>
<lastActive></lastActive>
</indexDesc>
<indexQuote>
<capital>
<first>11144.57</first>
<high>11153.79</high>
<low>10973.92</low>
<last>11018.66</last>
<change>-125.9</change>
<pctChange>-1.1%</pctChange>
</capital>
<gross>
<first>11144.57</first>
<high>11153.79</high>
<low>10973.92</low>
<last>11018.66</last>
<change>-125.9</change>
<pctChange>-1.1%</pctChange>
</gross>
<totalEvents>4</totalEvents>
<lastChanged>16-Apr-2010 16:03:00</lastChanged>
</indexQuote>
</index>
<index>
<code>XAO</code>
<exchange>ASX</exchange>
<liveness>DELAYED</liveness>
<indexDesc>
<desc>ASX All Ordinaries</desc>
<descAbbrev>All Ordinaries</descAbbrev>
<descShort>ALL ORDS</descShort>
<firstActive>06-Mar-1970</firstActive>
<lastActive></lastActive>
</indexDesc>
<indexQuote>
<capital>
<first>5007.30</first>
<high>5007.30</high>
<low>4934.00</low>
<last>4939.40</last>
<change>-67.9</change>
<pctChange>-1.4%</pctChange>
</capital>
<gross>
<first>5007.30</first>
<high>5007.30</high>
<low>4934.00</low>
<last>4939.40</last>
<change>-67.9</change>
<pctChange>-1.4%</pctChange>
</gross>
<totalEvents>997</totalEvents>
<lastChanged>19-Apr-2010 17:02:54</lastChanged>
</indexQuote>
</index>
</indices>
你必須更好地描述它。有多個'last'標籤,你想如何輸出?你能提供一個例子嗎? – 2010-04-19 17:46:41
對不起,我只想從「gross」父標記中獲得「last」值以及之前的shortDesc – Dkong 2010-04-19 18:58:34