2012-01-21 2 views

답변

2

사이의 모든 노드를 선택하는 방법을 참조 //h[.='unique-1']h 노드를 가리킬 수 있지만 찾을 수 없습니다, 당신은 following-siblingpreceding-sibling 축과 연계하여 intersect 연산자를 사용할 수 있습니다

  //h[.='unique-1']/following-sibling::* 
intersect //h[.='unique-2']/preceding-sibling::* 
XPath는 1.0에서

, 당신은 "Kaysian intersection"로 intersect 연산자를 시뮬레이션 할 수 있습니다 :

//h[.='unique-1']/following-sibling::*[ 
    count(.|//h[.='unique-2']/preceding-sibling::*) 
    = count(//h[.='unique-2']/preceding-sibling::*) 
] 
관련 문제