Learn R Programming

XiMpLe (version 0.03-21)

XMLName: Getter/setter methods for S4 objects of XiMpLe XML classes

Description

Used to get/set certain slots from objects of class XiMpLe.doc and XiMpLe.node.

Arguments

obj
An object of class XiMpLe.node or XiMpLe.doc

itemize

  • XMLScanDeep(obj, find, search="attributes"):

code

search

Details

These are convenience methods to get or set slots from XML objects without using the @ operator.

  • XMLName():
{get/set the XML node name (slot name of class XiMpLe.node)} XMLAttrs():{get/set the XML node attributes (slot attrs of class XiMpLe.node)} XMLValue():{get/set the XML node value (slot value of class XiMpLe.node)} XMLChildren():{get/set the XML child nodes (slot children of both classes XiMpLe.node and XiMpLe.doc)} XMLFile():{get/set the XML document file name (slot file of class XiMpLe.doc)} XMLDecl():{get/set the XML document declaration (slot xml of class XiMpLe.doc)} XMLDTD():{get/set the XML document doctype definition (slot dtd of class XiMpLe.doc)}

See Also

node, XiMpLe.doc, XiMpLe.node

Examples

Run this code
xmlTestNode <- XMLNode("foo", XMLNode("testchild"))
XMLName(xmlTestNode) # returns "foo"
XMLName(xmlTestNode) <- "bar"
XMLName(xmlTestNode) # now returns "bar"

# search for a child node
XMLScan(xmlTestNode, "testchild")
# remove nodes of that name
XMLScan(xmlTestNode, "testchild") <- NULL

Run the code above in your browser using DataLab