Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xmlElementSummary

Frequency table of names of elements and attributes in XML content


Description

This function is used to get an understanding of the use of element and attribute names in an XML document. It uses a collection of handler functions to gather the information via a SAX-style parser. The distribution of attribute names is done within each "type" of element (i.e. element name)

Usage

xmlElementSummary(url, handlers = xmlElementSummaryHandlers(url))

Arguments

url

the source of the XML content, e.g. a file, a URL, a compressed file, or a character string

handlers

the list of handler functions used to collect the information. These are passed to the function xmlEventParse as the value for the handlers parameter.

Value

A list with two elements

nodeCounts

a named vector of counts where the names are the (XML namespace qualified) element names in the XML content

attributes

a list with as many elements as there are elements in the nodeCounts element of the result. Each element of this sub-list gives the frequency counts for the different attributes seen within the XML elements with that name.

Author(s)

Duncan Temple Lang

See Also

Examples

xmlElementSummary(system.file("exampleData", "eurofxref-hist.xml.gz", package = "XML"))

XML

Tools for Parsing and Generating XML Within R and S-Plus

v3.99-0.10
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>), Tomas Kalibera [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.