XML THE ESSENTIALS
XML ARCHITECTURE
XML FIRST STEPS
XML EXPLORATION DRILLING
XML EXTRACTING DRILLING - 1
XML EXTRACTING DRILLING - 2
xmlValue
function used to extract value of a named XML node
e.g. xmlSApply(xmlNode[1][1] , xmlValue)
Will extract and display the content of the node corresponding to
subsection 1 of section 1 of the document
USING XPATH AS NODE POINTER -1
USING XPATH AS NODE POINTER -2
http://www.w3schools.com/xpath/xpath_syntax.asp
USING XPATH AS NODE POINTER -3
USING XPATH AS NODE POINTER -4
/bookstore/book[price>35.00] Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00
/bookstore/book[price>35.00]/title Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00
/bookstore/* Selects all the child nodes of the bookstore element
//* Selects all elements in the document
//title[@*] Selects all title elements which have any attribute
USING XPATH AS NODE POINTER -5
//book/title | //book/price Selects all the title AND price elements of all book elements
//title | //price Selects all the title AND price elements in the document
/bookstore/book/title | //price Selects all the title elements of the book element of the bookstore element AND all the price elements in the document
XPATH EXAMPLES
Part of the XML package
xpathSApply(rootNode,”//name”,xmlValue)
[1] “Belgian Waffles” “Strawberry Belgian Waffles” “Berry-Berry Belgian Waffles”
[4] “French Toast” “Homestyle Breakfast”
xpathSApply(rootNode,”//price”,xmlValue)
[1] “$5.95” “$7.95” “$8.95” “$4.50” “$6.95”