xmlTreeView {RGtkViewers} | R Documentation |
This displays a top-level window containing a
scrolling GtkTree
object that represents
the hierarchy of an XML document or node.
xmlTreeView(doc, createItem = function(x) gtkTreeItem(xmlName(x)))
doc |
the source of the XML nodes. This can be the name of a file
or URI in which case that document is read,
or it can be the result from an earlier call to
xmlTreeParse.
or xmlRoot , i.e. an XMLDocument XMLNode object. |
createItem |
a function that is used to create the
GtkTreeItem from the XMLNode object.
This makes it easy to create different views of the
nodes and to specify any callbacks to customize the behavior of
the nodes in the tree.
See xmlView which is the function that uses this.
|
An list containing the
GtkWindow
and the GtkTree
objects.
Duncan Temple Lang <duncan@research.bell-labs.com>
http://www.omegahat.org/RGtk http://www.omegahat.org/RSXML
# basic view that uses the xmlName() value of a node. xmlTreeView("http://www.ggobi.org/data/flea.xml") # customized view that uses the xmlName() and class of the node xmlTreeView("http://www.ggobi.org/data/flea.xml", createItem = function(x) gtkTreeItem(paste(xmlName(x), class(x)[1], sep=":"))) # basic view that uses the xmlName() value of a node. xmlTreeView("http://www.ggobi.org/data/flea.xml", createItem = function(x) { it <- gtkTreeItem(xmlName(x)) if(inherits(x, "XMLTextNode")) it$AddCallback("select", function(node, w) { print(xmlValue(node)) }, data = x) it })