Professional Documents
Culture Documents
Element
Attribute
Text
Namespace
processing-instruction
Comment
document nodes
XML documents di anggap sebagai tree
nodes (pohon node). element paling puncak
dari pohon tersebut di sebut root element.
Contoh
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="en"> </title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
atomic values
"en”
Harry Potter
2005
Relationship
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
Parent Bookstore adalah parent dari book, dan book adalah parent dari title, author, year
Children kebalikan, author adalah children dari book, dan book adalah children dari
bookstore
Sibling saudaraan, artinya cari yang mempnyai level sejajar, maka mereka adalah sibling,
misal title, author, year, dan price adalah semuanya sibling
Ancestor pokoknya yang ada di atas sebuah element itu ancestor
Decendant kebalikan dari ancestor, semua yang ada di bawah element adalah
decendant.
Dokumen XML Referensi
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="eng">Learning XML</title>
<price>39.95</price>
</book>
</bookstore>
Expression
Perhatikan contoh!
Expression - Predicate
Selalu baca element paling kanan!
Expression-con’t
Unknown Nodes
Contoh
Expression Con’t
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}
</script>