2011-12-08 8 views

答えて

1

次の形式の式を使用します

/*/c/following-sibling::*[(position() - 1) < 3] 
次の式を使用し

<test> 
    <a/> 
    <b/> 
    <c/> 
    <d/> 
    <e/> 
    <f/> 
    <g/> 
</test> 

:次のドキュメントで<c/>次の3人の兄弟を取得するには、例えば

/<path_to_element>/following-sibling::*[(position() - 1) < $n]