Skip to contents

This function accepts the output of the read_xml function (from package xml2) and returns a character vector with all non-empty nodes and all the present node attribute names. This function uses the basic structure of the function xml_structure from xml2 package.

Usage

get_xml_structure(x, warn.empty.nodes = FALSE)

Arguments

x

character The output of the function read_xml from package xml2, i.e. an object of class xml_document.

warn.empty.nodes

logical If FALSE (the default) warns nothing; TRUE warns of empty nodes.

Value

A character vector with the XML structure (non-empty nodes and all the present node attribute names).

Details

The function lists in a character vector all non-empty nodes, showing the type of data contained in the node between {} and all the present node attribute names, between []. The XML hierarchical structure is also presented, each level separated by :.

Author

Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.