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

SAXMethods

Generic Methods for SAX callbacks


Description

This is a collection of generic functions for which one can write methods so that they are called in repsonse to different SAX events. The idea is that one defines methods for different classes of the .state argument and dispatch to different methods based on that argument. The functions represent the different SAX events.

Usage

startElement.SAX(name, atts, .state = NULL)
endElement.SAX(name, .state = NULL)
comment.SAX(content, .state = NULL)
processingInstruction.SAX(target, content, .state = NULL)
text.SAX(content, .state = NULL)
entityDeclaration.SAX(name, base, sysId, publicId, notationName,  .state = NULL)
.InitSAXMethods(where = "package:XML")

Arguments

name

the name of the XML element or entity being declared

atts

named character vector of XML attributes

content

the value/string in the processing instruction or comment

target

the target of the processing instruction, e.g. the R in <?R....>

base

x

sysId

the system identifier for this entity

publicId

the public identifier for the entity

notationName

name of the notation specification

.state

the state object on which the user-defined methods should dispatch.

where

the package in which the class and method definitions should be defined. This is almost always unspecified.

Value

Each method should return the (potentially modified) state value.

Note

This no longer requires the Expat XML parser to be installed. Instead, we use libxml's SAX parser.

Author(s)

Duncan Temple Lang

References

See Also


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.