[.XMLNode                package:XML                R Documentation

_C_o_n_v_e_n_i_e_n_c_e _a_c_c_e_s_s_o_r_s _f_o_r _t_h_e _c_h_i_l_d_r_e_n _o_f _X_M_L_N_o_d_e _o_b_j_e_c_t_s.

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

     These provide a simplified syntax for extracting the children of
     an XML node.

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

     ## S3 method for class 'XMLNode':
     x[..., all = FALSE]
     ## S3 method for class 'XMLNode':
     x[[...]]
     ## S3 method for class 'XMLDocumentContent':
     x[[...]]

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

       x: the XML node or the top-level document content in which the
          children are to be accessed. The 'XMLDocumentContent' is the
          container for the top-level node that also contains
          information such as the URI/filename and XML version. This
          accessor method is merely a convenience to get  access to
          children of the top-level node.

     ...: the identifiers for the children to be retrieved, given as
          integer indices, names, etc. in the usual format for the
          generic 'link{[}' and 'link{[[}' operators

     all: logical value.  When ... is a character vector, a value of
          'TRUE' for 'all' means to retrieve all of the nodes with
          those names rather than just the first one. 'FALSE' gives the
          usual result of subsetting a list by name which gives just
          the first element. This allows us to avoid the  idiom 'node[
          names(node) == "bob" ]' which is complicated when node is the
          result of an inline computation and instead we use
          'node["bob", all = TRUE]'. 

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

     A list or single element containing the children of the XML node
     given by 'obj' and identified by ....

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

     'xmlAttrs' '[<-.XMLNode' '[[<-.XMLNode'

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

      f = system.file("exampleData", "gnumeric.xml", package = "XML")

      top = xmlRoot(xmlTreeParse(f))

       # Get the first RowInfo element.
      top[["Sheets"]][[1]][["Rows"]][["RowInfo"]]

       # Get a list containing only the first row element
      top[["Sheets"]][[1]][["Rows"]]["RowInfo"]
      top[["Sheets"]][[1]][["Rows"]][1]

       # Get all of the RowInfo elements by position
      top[["Sheets"]][[1]][["Rows"]][1:xmlSize(top[["Sheets"]][[1]][["Rows"]])]

       # But more succinctly and accurately, get all of the RowInfo elements
      top[["Sheets"]][[1]][["Rows"]]["RowInfo", all = TRUE]

