length.XMLNode.RdThis function is a simple way to compute the number
of sub-nodes (or children) an XMLNode object
possesses.
It is provided as a convenient form of calling the
xmlSize function.
# S3 method for class 'XMLNode'
length(x)An integer giving the number of sub-nodes of this node.
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
r <- xmlRoot(doc, skip=TRUE)
length(r)
#> [1] 33
# get the last entry
r[[length(r)]]
#> <record id="Volvo 142E">21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2</record>