Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/XML-XPath/R/xml-xpath.r
Normal file
11
Task/XML-XPath/R/xml-xpath.r
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
library("XML")
|
||||
doc <- xmlInternalTreeParse("test3.xml")
|
||||
|
||||
# Retrieve the first "item" element
|
||||
getNodeSet(doc, "//item")[[1]]
|
||||
|
||||
# Perform an action on each "price" element
|
||||
sapply(getNodeSet(doc, "//price"), xmlValue)
|
||||
|
||||
# Get an array of all the "name" elements
|
||||
sapply(getNodeSet(doc, "//name"), xmlValue)
|
||||
Loading…
Add table
Add a link
Reference in a new issue