read_xml_as_path_value: Read XML File as Pairs of Paths and Values

View source: R/read_xml_as_path_value.R

read_xml_as_path_valueR Documentation

Read XML File as Pairs of Paths and Values

Description

Read XML File as Pairs of Paths and Values

Usage

read_xml_as_path_value(xml, dbg = TRUE, max_length = 100)

Arguments

xml

path, url or literal xml or anything else that is accepted by read_xml as argument x

dbg

if TRUE, debug messages are shown

max_length

maximum number of characters reserved for printing the path to the folder of the xml file in the debug message

Value

data frame with the full paths to the XML elements in the first and the text values of the XML elements in the second column.

Examples

url <- "https://www.w3schools.com/xml/note.xml"

# Original XML content
kwb.utils::catLines(readLines(url, warn = FALSE))

# Interpretation as Paths and Values
kwb.read:::read_xml_as_path_value(url)


KWB-R/kwb.read documentation built on Oct. 2, 2023, 10:40 a.m.