Learn R Programming

xml2 (version 1.3.6)

xml_ns_strip: Strip the default namespaces from a document

Description

Strip the default namespaces from a document

Usage

xml_ns_strip(x)

Arguments

x

A document, node, or node set.

Examples

Run this code
x <- read_xml(
  "
   
   
     
   
  "
)
# 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")

Run the code above in your browser using DataLab