swh:1:snp:7d9f1bc35e120776766db9334626062f837c20ad
Tip revision: d22fc2b051e00c75cd367ab771b96f455d1e18ae authored by Duncan Temple Lang on 11 August 2004, 00:00:00 UTC
version 0.97-0
version 0.97-0
Tip revision: d22fc2b
xmlHandler.R
xmlHandler <-
function() {
data <- list()
startElement <- function(name, atts,...) {
if(is.null(atts))
atts <- list()
data[[name]] <<- atts
}
text <- function(x,...) {
cat("MyText:",x,"\n")
}
comment <- function(x,...) {
cat("comment", x,"\n")
}
externalEntity <- function(ctxt, baseURI, sysId, publicId,...) {
cat("externalEntity", ctxt, baseURI, sysId, publicId,"\n")
}
entityDeclaration <- function(name, baseURI, sysId, publicId,notation,...) {
cat("externalEntity", name, baseURI, sysId, publicId, notation,"\n")
}
foo <- function(x,attrs,...) { cat("In foo\n")}
return(list(startElement=startElement, getData=function() {data},
comment=comment, externalEntity=externalEntity,
entityDeclaration=entityDeclaration,
text=text, foo=foo))
}