length.XMLNode: Determine the number of children in an XMLNode object.

Description Usage Arguments Value Author(s) References See Also Examples

Description

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.

Usage

1
2
## S3 method for class '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.

Author(s)

Duncan Temple Lang

References

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

See Also

xmlSize xmlChildren

Examples

1
2
3
4
5
  doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
  r <- xmlRoot(doc, skip=TRUE)
  length(r)
    # get the last entry
  r[[length(r)]]

cosmicexplorer/xmlr documentation built on May 30, 2019, 8:28 a.m.