xml_ns_strip | R Documentation |
Strip the default namespaces from a document
xml_ns_strip(x)
x |
A document, node, or node set. |
x <- read_xml(
"<foo xmlns = 'http://foo.com'>
<baz/>
<bar xmlns = 'http://bar.com'>
<baz/>
</bar>
</foo>"
)
# Need to specify the default namespaces to find the baz nodes
xml_find_all(x, "//d1:baz")
xml_find_all(x, "//d2:baz")
# After stripping the default namespaces you can find both baz nodes directly
xml_ns_strip(x)
xml_find_all(x, "//baz")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.