XQuery Terimleri

XQuery'da yedi tür nod vardır: element, özellik, metin, ad alanı, işletim talimatı, yorum ve belge nodu (veya kök nod olarak adlandırılır).

XQuery Terimleri

Nod

XQuery'da yedi tür nod vardır: element, özellik, metin, ad alanı, işletim talimatı, yorum ve belge (kök) nodu. XML belgesi nod ağacı olarak ele alınır. Ağacın kökü belge nodu veya kök nod olarak adlandırılır.

Aşağıdaki XML belgesini görün:

<?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>

Yukarıdaki XML belgesindeki nod örnekleri:

<bookstore>  (belge nodu)
<author>J K. Rowling</author>  (element nodu)
lang="en"  (özellik nodu)

Temel değer (veya atomik değer olarak adlandırılır, Atomic value)

Temel değerler ebeveyni veya çocuğu olmayan nodlardır.

Temel değerlerin örneği:

J K. Rowling
"en"

Proje

Proje temel bir değer veya noddur.

Nod ilişkileri

Ebeveyn (Parent)

Her element ve özellik bir ebeveyni vardır.

Aşağıdaki örnekte, book öğesi title, author, year ve price öğelerinin ebeveyni:

<book>
  <title>Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>

Çocuk (Children)

Bir nod elementi sıfır, bir veya çok çocuk olabilir.

Aşağıdaki örnekte, title, author, year ve price öğeleri book öğesinin çocukları:

<book>
  <title>Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>

Kardeş (Sibling)

Aynı ebeveyni paylaşan nodlar.

Aşağıdaki örnekte, title, author, year ve price öğeleri kardeşler:

<book>
  <title>Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>

Ata (Ancestor)

Bir节点的父节点,父的父节点,等等.

Aşağıdaki örnekte, title öğesinin ataları book ve bookstore öğeleri:

<bookstore>
<book>
  <title>Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>
</bookstore>

Soy (Descendant)

Bir节点的子节点,孙节点,等等.

Aşağıdaki örnekte, bookstore'nun soyu book, title, author, year ve price öğeleri:

<bookstore>
<book>
  <title>Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>
</bookstore>