Learn R Programming

xml2 (version 0.1.0)

xml_name: The (tag) name of an xml element.

Description

The (tag) name of an xml element.

Usage

xml_name(x, ns = character())

Arguments

x
A document, node, or node set.
ns
Optionally, a named vector giving prefix-url pairs, as produced by xml_ns. If provided, all names will be explicitly qualified with the ns prefix, i.e. if the element bar is defined in namespace

Value

  • A character vector.

Examples

Run this code
x <- read_xml("<bar>123</bar>")
xml_name(x)

y <- read_xml("<bar><baz>1</baz>abc<foo /></bar>")
z <- xml_children(y)
xml_name(xml_children(y))

Run the code above in your browser using DataLab