xmlParserContextFunction         package:XML         R Documentation

_I_d_e_n_t_i_f_i_e_s _f_u_n_c_t_i_o_n _a_s _e_x_p_e_c_t_i_n_g _a_n _x_m_l_P_a_r_s_e_r_C_o_n_t_e_x_t _a_r_g_u_m_e_n_t

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

     This is a convenience function for setting the class of the
     specified function to include "XMLParserContextFunction". This
     identifies it as expecting an  'xmlParserCtxt' object as its first
     argument. The resulting function can be passed to the
     internal/native XML parser as a handler/callback function. When
     the parser calls it, it recognizes this class information and
     includes a reference to the C-level 'xmlParserCtxt'  object as the
     first argument in the call.

     This 'xmlParserCtxt' object can be used to gracefull terminate the
     parsing (without an error),  and in the future will also provide
     access to details about the current state of the parser, e.g. the
     encoding of the file, the XML version,  whether entities are being
     replaced,  line and column number for each node processed.

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

      xmlParserContextFunction(f, class = "XMLParserContextFunction")

_A_r_g_u_m_e_n_t_s:

       f: the function whose class information is to be augmented.

   class: the name of the class which is to be added to the 'class'
          attribute of the function.

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

     The function object 'f' whose class attribute has been prepended
     with the value of 'class'.

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

     Duncan Temple Lang

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

     'xmlInternalTreeParse'/'xmlParse' and the 'branches' parameter of 
     'xmlEventParse'.

