xmlElementsByTagName           package:XML           R Documentation

_R_e_t_r_i_e_v_e _t_h_e _c_h_i_l_d_r_e_n _o_f _a_n _X_M_L _n_o_d_e _w_i_t_h _a _s_p_e_c_i_f_i_c _t_a_g _n_a_m_e

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

     This returns a list of the children or sub-elements of an XML node
     whose tag name matches the one specified by the user.

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

     xmlElementsByTagName(el, name)

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

      el: the node whose matching children are to be retrieved.

    name: a string giving the name of the tag to match in each of 
          'el''s children.

_D_e_t_a_i_l_s:

     This does a simple matching of names and subsets the XML node's
     children list.

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

     A list containing those child nodes of 'el' whose tag name matches
     that specified by the user.

_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.omegahat.org/RSXML>,

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

     'xmlChildren' 'xmlTreeParse'

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

     ## Not run: 
      doc <- xmlTreeParse("http://www.omegahat.org/Scripts/Data/mtcars.xml")
      xmlElementsByTagName(doc$children[[1]], "variable")
     ## End(Not run)

      doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
      xmlElementsByTagName(xmlRoot(doc)[[1]], "variable")

