xmlApply                 package:XML                 R Documentation

_A_p_p_l_i_e_s _a _f_u_n_c_t_i_o_n _t_o _e_a_c_h _o_f _t_h_e _c_h_i_l_d_r_e_n _o_f _a_n _X_M_L_N_o_d_e

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

     These methods are simple wrappers for the  'lapply' and 'sapply'
     functions. They operate on the  sub-nodes of the XML node, and not
     on the fields of the node object itself.

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

     xmlApply(X, FUN, ...)
     xmlApply.XMLNode(X, FUN, ...)
     xmlApply.XMLDocument(X, FUN, ...)
     xmlApply.XMLDocumentContent(X, FUN, ...)
     xmlSApply(X, FUN, ...)
     xmlSApply.XMLNode(X, FUN, ...)
     xmlSApply.XMLDocument(X, FUN, ...)

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

       X: the 'XMLNode' on whose children the regular 'apply' or
          'sapply' is to be performed

     FUN: the function to apply to each child node. This is passed
          directly to the relevant 'apply' function.

     ...: additional arguments to be given to each invocation of 'FUN'.
          This is passed directly to the relevant 'apply' function.

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

     The result is that obtained from calling  the 'apply' or 'sapply'
     on 'xmlChildren(x)'.

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

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.w3.org/XML>, <URL: http://www.jclark.com/xml>,
     <URL: http://www.omegahat.org>

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

     'xmlChildren' 'xmlRoot' '[.XMLNode'

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

      doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
      r <- xmlRoot(doc)
      xmlSApply(r[[2]], xmlName)

      xmlApply(r[[2]], xmlAttrs)

      xmlSApply(r[[2]], xmlSize)

