Learn R Programming

openxlsx2 (version 1.4)

pugixml: xml_node

Description

returns xml values as character

Usage

xml_node(xml, level1 = NULL, level2 = NULL, level3 = NULL, ...)

xml_node_name(xml, level1 = NULL, level2 = NULL, ...)

xml_value(xml, level1 = NULL, level2 = NULL, level3 = NULL, ...)

xml_attr(xml, level1 = NULL, level2 = NULL, level3 = NULL, ...)

Arguments

xml

something xml

level1

to please check

level2

to please check

level3

to please check

...

additional arguments passed to read_xml()

Details

This function returns XML nodes as used in openxlsx2. In theory they could be returned as pointers as well, but this has not yet been implemented. If no level is provided, the nodes on level1 are returned

Examples

Run this code
  x <- read_xml("")
  # return a
  xml_node(x, "a")
  # return b. requires the path to the node
  xml_node(x, "a", "b")
  xml_node_name("")
  xml_node_name("", "a")
  x <- read_xml("1")
  xml_value(x, "a")

  x <- read_xml("2")
  xml_value(x, "a", "b")

  x <- read_xml("1")
  xml_attr(x, "a")

  x <- read_xml("2")
  xml_attr(x, "a", "b")
  x <- read_xml("1")
  xml_attr(x, "a")

  x <- read_xml("")
  xml_attr(x, "b", "a")

Run the code above in your browser using DataLab