XQuery 용어
- 이전 페이지 XQuery HTML
- 다음 페이지 XQuery 문법
XQuery에서는 일곱 가지 노드가 있습니다: 요소, 속성, 텍스트, 이름 공간, 처리 지시, 주석 및 문서 노드(또는 루트 노드)입니다.
XQuery 용어
노드
XQuery에서는 일곱 가지 노드가 있습니다: 요소, 속성, 텍스트, 이름 공간, 처리 지시, 주석 및 문서(루트) 노드입니다. XML 문서는 노드 트리로 대합니다. 트리의 루트는 문서 노드 또는 루트 노드로 불립니다。
아래의 XML 문서를 보세요:
<?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
위의 XML 문서의 노드 예제:
<bookstore> (문서 노드) <author>J K. Rowling</author> (요소 노드) lang="en" (속성 노드)
기본 값(또는 원자 값, Atomic value)
기본 값은 부모나 자식이 없는 노드입니다。
기본 값의 예제:
J K. Rowling "en"
항목
항목은 기본 값이나 노드입니다。
노드 관계
부모(Parent)
각 요소와 속성은 부모가 하나 있습니다。
아래의 예제에서 book 요소는 title, author, year 및 price 요소의 부모입니다:
<book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book>
자식(Children)
노드 요소는 자식이 없을 수도 있고 하나일 수도 있으며 여러 개일 수 있습니다。
아래의 예제에서 title, author, year 및 price 요소는 book 요소의 자식입니다:
<book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book>
형제(Sibling)
같은 부모를 가진 노드입니다。
아래의 예제에서 title, author, year 및 price 요소는 형제입니다:
<book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book>
조상(Ancestor)
특정 노드의 부모, 부모의 부모 등입니다。
아래의 예제에서 title 요소의 조상은 book 요소와 bookstore 요소입니다:
<bookstore> <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
자식(Descendant)
특정 노드의 자식, 자식의 자식 등입니다。
아래의 예제에서 bookstore의 자식은 book, title, author, year 및 price 요소입니다:
<bookstore> <book> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
- 이전 페이지 XQuery HTML
- 다음 페이지 XQuery 문법