xmlHandler                package:XML                R Documentation

_E_x_a_m_p_l_e _X_M_L _E_v_e_n_t _P_a_r_s_e_r _H_a_n_d_l_e_r _F_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     xmlHandler()

_V_a_l_u_e:

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

_N_o_t_e:

     This is just an example.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_S_e_e _A_l_s_o:

     xmlEventParse, xmlTreeParse

_E_x_a_m_p_l_e_s:

     ## 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)

