Description Usage Arguments Value Examples
This is a helper function that uses xml_find_first
to retrieve a node and
then retrieves the specified attribute on that node.
1 | xml_find_attr(x, xpath, attr, ns = xml_ns(x))
|
x |
A document, node or node set |
xpath |
A string containing a xpath (1.0) expression |
attr |
Name of attribute to extract |
ns |
Optionally, a named vector giving prefix-url pairs, as produced
by |
A character vector. NA
is used to represent of attributes that
aren't defined.
1 2 | x <- xml2::read_xml("<a id='foo' />")
xml_find_attr(x, "/a", "id")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.