Learn R Programming

XML (version 0.7-1)

xmlHandler: Example XML Event Parser Handler Functions

Description

A closure containing simple functions for the different types of events potentially called by the xmlEventParse, and some tag-specific functions to illustrate how one can add functions for specific DTDs and XML element types. Contains a local list which can be mutated by invocations of the closure's function.

Usage

xmlHandler()

Arguments

Value

  • List containing the functions enumerated in the closure definition along with the list.

See Also

xmlEventParse, xmlTreeParse

Examples

Run this code
xmlURL <- "http://www.omegahat.org/Scripts/Data/mtcars.xml"
xmlText <- paste(scan.url(xmlURL, what="", sep="\n"),"\n",collapse="\n")

xmlURL <- system.file("exampleData", "mtcars.xml", package="XML")
xmlText <- paste(readLines(xmlURL), "", collapse="")
xmlEventParse(xmlText, handlers = NULL, asText=T)
xmlEventParse(xmlText, xmlHandler(), useTagName=T, asText=T)

Run the code above in your browser using DataLab