xml 문서의 노드들이나 노드들의 그룹을 선택하기 위해 사용됨

Contents

1 리턴값
2 절대위치경로(Absolute Location Path)
3 상대위치경로(Relative Location Path)
4 location step의 구성
4.1 axis(축)
4.2 node-test
4.3 predicate
5 예제

1 리턴값 #

Location Path는 항상 노드집합(node-set)을 리턴한다.
루트노드(Root Location Path) : /

2 절대위치경로(Absolute Location Path) #

/elm1/elm2/elm3

3 상대위치경로(Relative Location Path) #

dir/dir2

위에서 elm1, elm2 등을 Location step이라고 한다.

4 location step의 구성 #

axis::node-test[predicate]*

4.1 axis(축) #

검색축
self, child, parent, attribute, descendant, descendant-or-self, ancestor, ancestor-or-self, following, following-sibiling, preceding, preceding-sibling, namespace

child 축은 생략가능 아래 두개의 예는 같은 내용
child::product/child::name
product/name

attribute 는 @으로 표현 가능 아래 두개는 같은 내용
child::product/attirubte::id
product/@id

최상위 xmlDocument를 나타냄(최상위 엘리먼트가 아니라...)
/

현재경로(생략가능)
./

모든항목
//
//title --> 문서내의 모든 title
records//price --> 현재경로에 있는 records 노드 아래 모든 노드중 price 

4.2 node-test #

location step에 의해 선택될 노드의 타입과 이름 지정

4.3 predicate #

location step에 의해 검색된 노드 집합에 대한 필터링을 위한 표현식

5 예제 #

/child::catalog/child::product[child::price>15.00]
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2008-08-27 17:32:32
Processing time 0.0101 sec