<categories>
<member>
<name> Ants </name>
<size> 8 </size>
<submember>
<structure>
<name>Acrobat Ants </name>
<size>Slightly over 1/8" </size>
<color>Tan, red with heart shaped abdomen </color>
<habitat>Inside moist wood</habitat>
<found>Throughout the US</found>
<desc></desc>
<productLink> </productLink>
</structure>
<structure>
<name>Argentine Ant </name>
<size>About 1/16" </size>
<color>Light to dark brown </color>
<habitat>Shallow areas with moist soil</habitat>
<origin>Argentina and Brazil</origin>
<desc></desc>
<productLink></productLink>
</structure>
<structure>
<name>Carpenter Ants </name>
<size>1/4-1/2" </size>
<color>Varies</color>
<Habitat>Inside decayed or moist wood</Habitat>
<Found>Throughout the US</Found>
<desc>C</desc>
<productLink></productLink>
</structure>
</submember>
</member>
</categories>
比方說,我有這樣一個XML文件(實際的XML是更長的時間比這個),那麼我如何才能「螞蟻」結構使用XPath?XML的XPath問題
好問題,+1。查看我的答案,瞭解兩個選擇所需節點的XPath表達式。 :) – 2011-03-21 13:35:15