You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

154 lines
6.2 KiB

<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xml_tree_view. htmltidy</title>
<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">htmltidy</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">Home</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li>
<a href="../news/index.html">News</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/htmltidy">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="page-header">
<h1>HTML/XML tree viewer</h1>
</div>
<div class="row">
<div class="col-md-9">
<p>This uses the <code>xml-viewer</code> JavaScript module to provide a simple collapsible
tree viewer for HTML/XML documents, nodes, node sets and plain character
HTML/XML in an <code>htmlwidget</code> pane.</p>
<pre><span class='fu'>xml_tree_view</span>(<span class='kw'>doc</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>scroll</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>elementId</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>width</span> <span class='kw'>=</span> <span class='st'>"100%"</span>, <span class='kw'>height</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)
<span class='fu'>html_tree_view</span>(<span class='kw'>doc</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>scroll</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>elementId</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>width</span> <span class='kw'>=</span> <span class='st'>"100%"</span>, <span class='kw'>height</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
<h2>Arguments</h2>
<dl class="dl-horizontal">
<dt>doc</dt>
<dd><code>xml2</code> document/node/nodeset, an <code>HTMLInternalDocument</code>/
<code>XMLInternalDocument</code> or atomic character vector of HTML/XML content</dd>
<dt>scroll</dt>
<dd>should the <code>&lt;div&gt;</code> holding the HTML/XML content scroll
(<code>TRUE</code>) or take up the full viewer/browser window (<code>FALSE</code>).
Default is <code>FALSE</code> (take up the full viewer/browser window). If
this is set to <code>TRUE</code>, <code>height</code> should be set to a value
other than <code>NULL</code>.</dd>
<dt>elementId</dt>
<dd>element id</dd>
<dt>width</dt>
<dd>widget <code>div</code> width</dd>
<dt>height</dt>
<dd>widget <code>div</code> height</dd>
</dl>
<div class="Note">
<h2>Note</h2>
<p>Large HTML or XML content may take some time to render properly. It is suggested
that this function be used on as minimal of a subset of HTML/XML as possible
or used in a browser context vs an IDE viewer context.</p>
</div>
<div class="References">
<h2>References</h2>
<p><a href = 'xml-viewer'>https://github.com/juliangruber/xml-viewer</a></p>
</div>
<h2 id="examples">Examples</h2>
<pre class="examples"><div class='input'><span class='co'>## Not run: ------------------------------------</span>
<span class='co'># library(htmltidy)</span>
<span class='co'># </span>
<span class='co'># # from ?xml2::read_xml</span>
<span class='co'># cd &lt;- xml2::read_xml("http://www.xmlfiles.com/examples/cd_catalog.xml")</span>
<span class='co'># </span>
<span class='co'># xml_tree_view(cd)</span>
<span class='co'># </span>
<span class='co'># htmltools::browsable(</span>
<span class='co'># htmltools::tagList(</span>
<span class='co'># xml_tree_view(cd, width = "100%", height = "300px"),</span>
<span class='co'># xml_view(cd)</span>
<span class='co'># )</span>
<span class='co'># )</span>
<span class='co'>## ---------------------------------------------</span></div></pre>
</div>
<div class="col-md-3">
</div>
</div>
<footer>
<p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
</footer>
</div>
</body>
</html>