length.XMLNode

0th

Percentile

Determine the number of children in an XMLNode object.

This 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.

Keywords
file
Usage
# S3 method for XMLNode
length(x)
Arguments
x

the XMLNode object whose length is to be queried.

Value

An integer giving the number of sub-nodes of this node.

References

http://www.w3.org/XML, http://www.jclark.com/xml, http://www.omegahat.net

See Also

xmlSize xmlChildren

Aliases
  • length.XMLNode
Examples
# NOT RUN {
  doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
  r <- xmlRoot(doc, skip=TRUE)
  length(r)
    # get the last entry
  r[[length(r)]]
# }
Documentation reproduced from package XML, version 3.98-1.19, License: BSD_2_clause + file LICENSE

Community examples

Looks like there are no examples yet.