xmlHandler

0th

Percentile

Example XML Event Parser Handler Functions

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.

Keywords
file, IO
Usage
xmlHandler()
Value

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

Note

This is just an example.

See Also

xmlEventParse, xmlTreeParse

Aliases
  • xmlHandler
Examples
# NOT RUN {
xmlURL <- "http://www.omegahat.net/Scripts/Data/mtcars.xml"
xmlText <- paste(scan(xmlURL, what="", sep="\n"),"\n",collapse="\n")
# }
# NOT RUN {
xmlURL <- system.file("exampleData", "mtcars.xml", package="XML")
xmlText <- paste(readLines(xmlURL), "\n", collapse="")
xmlEventParse(xmlText, handlers = NULL, asText=TRUE)
xmlEventParse(xmlText, xmlHandler(), useTagName=TRUE, asText=TRUE)
# }
Documentation reproduced from package XML, version 3.98-1.19, License: BSD_2_clause + file LICENSE

Community examples

Looks like there are no examples yet.