반응형
다른 노드에 대한 XPath OR 연산자
XPath로 어떻게 할 수 있습니까?
//bookstore/book/title or //bookstore/city/zipcode/title
그냥 //title
나는 또한 가지고 있기 때문에 작동하지 않습니다//bookstore/magazine/title
추신 : 나는 많은 속성이나 예제를 보았지만 주로 속성이나 단일 노드 구조를 가지고있었습니다.
부모 title
가 zipcode
있거나 book
노드 인 모든 노드 :
버전 1 :
//title[parent::zipcode|parent::book]
버전 2 :
//bookstore/book/title|//bookstore/city/zipcode/title
공용체 연산자로 두 노드 중 하나만 선택하려는 경우이 솔루션을 사용할 수 있습니다. (//bookstore/book/title | //bookstore/city/zipcode/title)[1]
요소에는 두 개의 xpath가 있습니다. 그런 다음 아래와 같이 두 개의 xpath를 작성할 수 있습니다
xpath1 | xpath2
예 : // input [@ name = "username"] | // input [@ id = "wm_login-username"]
참고 URL : https://stackoverflow.com/questions/5350666/xpath-or-operator-for-different-nodes
반응형
'IT' 카테고리의 다른 글
양식 제출 jQuery에서 기본값 방지 (0) | 2020.07.05 |
---|---|
기본 디렉토리가 아닌 설치합니까? (0) | 2020.07.05 |
CSS를 사용하여 텍스트를 늘릴 수 있습니까? (0) | 2020.07.05 |
Matplotlib의 빈 크기 (히스토그램) (0) | 2020.07.05 |
AngularJS와 달러 변수 사용 (0) | 2020.07.05 |