\Header{xmlHandler}{Example XML Event Parser Handler Functions}
\keyword{file}{xmlHandler}
\keyword{IO}{xmlHandler}
\begin{Description}\relax
A closure containing simple functions for the different
types of events potentially called by the \link{xmlEventParse},
and some tag-specific functions to illustrate how one can
add functions for specific DTDs and XML element types.
Contains a local \link{list} which can be mutated
by invocations of the closure's function.
\end{Description}
\begin{Usage}
\begin{verbatim}
xmlHandler()
\end{verbatim}
\end{Usage}
\begin{Value}
List containing the functions enumerated
in the closure definition along with the
\link{list}.
\end{Value}
\begin{Note}\relax
This is just an example.
\end{Note}
\begin{Author}\relax
Duncan Temple Lang
\end{Author}
\begin{SeeAlso}\relax
\link{xmlEventParse}, \link{xmlTreeParse}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
xmlURL <- "http://www.omegahat.org/Scripts/Data/mtcars.xml"
xmlText <- paste(scan(xmlURL, what="", sep="\n"),"\n",collapse="\n")
## End(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)
\end{ExampleCode}
\end{Examples}

