flatXML - Tools for Working with XML Files as R Dataframes

Overview

flatxml provides functions to easily deal with XML files. When parsing an XML document with fxml_importXMLFlat, flatxml produces a special dataframe that is ‘flat’ by its very nature but contains all necessary information about the hierarchical structure of the underlying XML document (for details on the dataframe see the reference for the fxml_importXMLFlat function).

flatxml offers a set of functions to work with this dataframe.

Apart from representing the XML document in a dataframe structure, there is yet another way in which flatxml relates to dataframes: the fxml_toDataFrame and fxml_toXML functions can be used convert XML data to dataframes and vice versa.

Each XML element, for example <tag attribute="some value">Here is some text</tag> has certain characteristics that can be accessed via the flatxml interface functions, after an XML document has been imported with fxml_importXMLFlat. These characteristics are:

Structure of the flatxml interface

The flatxml interface to access these characteristics follows a simple logic: For each of the characteristics there are typically three functions available:

Functions to access the characteristics of an XML element

For values:

For attributes:

For children:

For parents:

For siblings:

Functions for searching in the XML document

Functions for converting between XML and dataframe

Other functions