
Last chance! 50% off unlimited learning
Sale ends in
xmlNode(name, ..., attrs=NULL, namespace="", namespaceDefinitions = NULL, .children = list(...))
xmlTextNode(value, namespace="", entities = XMLEntities, cdata = FALSE)
xmlPINode(sys, value, namespace="")
xmlCDataNode(...)
xmlCommentNode(text)
..
XMLNode
or arbitrary values that will be converted to a string
to form an XMLTextNode
object.XMLTextNode
.>
and &
.
XMLNode
.
In the case of xmlTextNode
,
this also inherits from XMLTextNode
.
The fields or slots that objects
of these classes have
include
name
, attributes
, children
and namespace
.
However, one should
the accessor functions
xmlName
,
xmlAttrs
,
xmlChildren
and
xmlNamespace
addChildren
xmlTreeParse
asXMLNode
newXMLNode
newXMLPINode
newXMLCDataNode
newXMLCommentNode
# node named arg with two children: name and defaultValue
# Both of these have a text node as their child.
n <- xmlNode("arg", attrs = c(default="TRUE"),
xmlNode("name", "foo"), xmlNode("defaultValue","1:10"))
# internal C-level node.
a = newXMLNode("arg", attrs = c(default = "TRUE"),
newXMLNode("name", "foo"),
newXMLNode("defaultValue", "1:10"))
xmlAttrs(a) = c(a = 1, b = "a string")
xmlAttrs(a) = c(a = 1, b = "a string", append = FALSE)
newXMLNamespace(a, c("r" = "http://www.r-project.org"))
xmlAttrs(a) = c("r:class" = "character")
xmlAttrs(a[[1]]) = c("r:class" = "character")
# Using a character vector as a namespace definitions
x = xmlNode("bob",
namespaceDefinitions = c(r = "http://www.r-project.org",
omg = "http://www.omegahat.net"))
Run the code above in your browser using DataLab