xmlChildren               package:XML               R Documentation

_G_e_t_s _t_h_e _s_u_b-_n_o_d_e_s _w_i_t_h_i_n _a_n _X_M_L_N_o_d_e _o_b_j_e_c_t.

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

     These functions provide access to the children of the given XML
     node. The simple accessor returns a list of child XMLNode objects
     within an XMLNode object.

     The assignment operator ('xmlChildren<-') sets the children of the
     node to the given value and returns the updated/modified node.  No
     checking is currently done on the type and values of the right
     hand side. This allows the children of the node to be arbitrary R
     objects.  This can be useful but means that one cannot rely on any
     structure in a node being present..

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

     xmlChildren(x, addNames= TRUE)

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

       x: an object of class XMLNode.

addNames: a logical value indicating whether to add the XML names of
          the nodes as names of the R list. This is only relevant for
          XMLInternalNode objects as XMLNode objects in R already have
          R-level names. 

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

     A list whose elements are sub-nodes of the user-specified XMLNode.
     These are also of class XMLNode.

_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>

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

     'xmlChildren','xmlSize', 'xmlTreeParse'

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

       fileName <- system.file("exampleData", "mtcars.xml", package="XML")
       doc <- xmlTreeParse(fileName)
       names(xmlChildren(doc$doc$children[["dataset"]]))

