File: AssignXMLNode.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 (48 lines) | stat: -rw-r--r-- 1,364 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
39
40
41
42
43
44
45
46
47
48
\name{[<-.XMLNode}
\alias{[<-.XMLNode}
\alias{[[<-.XMLNode}
\title{Assign sub-nodes to an XML node}
\description{
 These functions allow one to assign a sub-node
to an existing XML node by name or index.
 These are the assignment equivalents of the 
subsetting accessor functions.
They are typically called indirectly
via the assignment operator, such as 
\code{x[["myTag"]] <- xmlNode("mySubTag")}.
}
\usage{
\method{[}{XMLNode}(x, i) <- value
\method{[}{XMLNode}(x, i) <-  value
\method{[[}{XMLNode}(x, i) <- value
}
\arguments{
  \item{x}{the \code{XMLNode} object to which the sub-node is to be assigned.}
  \item{i}{the identifier for the position  in the list of children
  of \code{x} into which the right-hand-side node(s) should be assigned.
  These can be either numbers or names.}
  \item{value}{one or more \code{XMLNode} objects which are to be the sub-nodes
 of \code{x}.}
}
\value{
 The XML node \code{x} containing the new or modified
nodes.
}
\references{\url{http://www.w3.org}, \url{http://www.omegahat.net/RSXML}}
\author{Duncan Templle Lang}


\seealso{
\code{\link{[.XMLNode}}
\code{\link{[[.XMLNode}}
\code{\link{append.xmlNode}}
\code{\link{xmlSize}}
}

\examples{
 top <- xmlNode("top", xmlNode("next","Some text"))
 top[["second"]] <- xmlCDataNode("x <- 1:10")
 top[[3]] <- xmlNode("tag",attrs=c(id="name"))
}
\keyword{IO}
\keyword{file}