xml_tree_view: XML tree viewer

Description Usage Arguments References Examples

View source: R/xmltreeview.R

Description

This uses xml-viewer to provide a simple collapsible tree viewer for HTML/XML documents, nodes, node sets and plain character HTML/XML in an htmlwidget pane.

Usage

1
2
xml_tree_view(doc = NULL, scroll = FALSE, elementId = NULL,
  width = "100%", height = NULL)

Arguments

doc

xml2 document, node, nodeset or atomic character vector of HTML/XML content

scroll

should the <div> holding the HTML/XML content scroll (TRUE) or take up the full viewer/browser window (FALSE). Default is FALSE (take up the full viewer/browser window). If this is set to TRUE, height should be set to a value other than NULL.

elementId

element id

width

widget div width

height

widget div height

References

xml-viewer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(xmlview)

# from ?xml2::read_xml
cd <- xml2::read_xml("http://www.xmlfiles.com/examples/cd_catalog.xml")

xml_tree_view(cd)

htmltools::browsable(
  htmltools::tagList(
    xml_tree_view(cd, width = "100%", height = "300px"),
    xml_view(cd)
  )
)

hrbrmstr/xmlview documentation built on May 17, 2019, 5:54 p.m.