File: length.XMLNode.Rd

package info (click to toggle)
r-cran-xml 3.98-1.5-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 9,464 kB
  • ctags: 636
  • sloc: xml: 79,579; ansic: 6,518; asm: 644; sh: 16; makefile: 1
file content (38 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (3)
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{http://www.w3.org/XML}, \url{http://www.jclark.com/xml},
\url{http://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}