Learn R Programming

mclm (version 0.2.7)

mclm_xml_text: Get text from xml node

Description

Get text from xml node

Usage

mclm_xml_text(node, trim = FALSE)

Value

Character vector: The text value of the (elements of the) node, concatenated with spaces in between.

Arguments

node

XML node as read with xml2::read_xml().

trim

If TRUE will trim leading and trailing spaces.

Examples

Run this code
test_xml <- '

  The
  example
  .
'

test_xml_parsed <- xml2::read_xml(test_xml)

# xml2 output
xml2::xml_text(test_xml_parsed)

# mclm version
mclm_xml_text(test_xml_parsed)

Run the code above in your browser using DataLab