Learn R Programming

htmltidy (version 0.5.0)

xml_tree_view: HTML/XML tree viewer

Description

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

Usage

xml_tree_view(doc = NULL, mode = c("traditional", "modern"),
  scroll = FALSE, width = "100%", height = NULL)

html_tree_view(doc = NULL, mode = c("traditional", "modern"), scroll = FALSE, width = "100%", height = NULL)

Arguments

doc

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

mode

viewer mode. traditional uses tag notation; modern favors readability oveer angle brackets.

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.

width

widget div width

height

widget div height

References

xonomy xml viewer

Examples

Run this code
# NOT RUN {
if(interactive()) {
txt <- paste0("<note><to>Tove</to><from>Jani</from><heading>Reminder</heading>",
              "<body>Don't forget me this weekend!</body></note>")
# xml_tree_view(txt)
}
# }

Run the code above in your browser using DataLab