2017-09-19 6 views
0
<entry name="A" /> 
<entry name="B" /> 
<entry name="C" /> 
<entry name="D" /> 
<entry name="E" /> 
<entry name="F" /> 
<entry name="." /> 
<entry name="." /> 
<entry name="." /> 
<entry name="Z" /> 

BとFの間の「入力」ノードを選択したいと思います。前後の兄弟を組み合わせて選択する方法はありますか?現在、私はBとFの位置()を見つけることでこれを選択することができますが、私はより良い解決策が必要です。xPathでposition()を使わずに特定の範囲に入るノードを選択する方法は?

+6

([前のと同じXPathクエリで兄弟を、以下の使用を組み合わせ]の可能重複https://stackoverflow.com/questions/3388923/same-xpath-queryの前後の兄弟の使用を組み合わせる) – Andersson

答えて

0

あなたは、次のようなXPathを使用することができます。

//entry[@name='B']/following::*[./following::entry[@name='F']]

Please see this is picture

関連する問題