1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
\name{length.XMLNode}
\alias{length.XMLNode}
\title{Determine the number of children in an XMLNode object.}
\description{
This function is a simple way to compute the number
of sub-nodes (or children) an \code{XMLNode} object
possesses.
It is provided as a convenient form of calling the
\code{\link{xmlSize}} function.
}
\usage{
\method{length}{XMLNode}(x)
}
\arguments{
\item{x}{the \code{XMLNode} object whose length is to be queried.}
}
\value{
An integer giving the number of sub-nodes
of this node.
}
\references{\url{https://www.w3.org/XML/}, \url{http://www.jclark.com/xml/},
\url{https://www.omegahat.net} }
\author{ Duncan Temple Lang }
\seealso{
\code{\link{xmlSize}}
\code{\link{xmlChildren}}
}
\examples{
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
r <- xmlRoot(doc, skip=TRUE)
length(r)
# get the last entry
r[[length(r)]]
}
\keyword{file}
|