xmlRoot                 package:XML                 R Documentation

_G_e_t _t_h_e _t_o_p-_l_e_v_e_l _X_M_L _n_o_d_e.

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

     These are a collection of methods for providing easy access to the
     top-level 'XMLNode' object resulting from parsing an XML document.
      They simplify accessing this node in the presence of auxillary
     information such as DTDs, file name and version information that
     is returned as part of the parsing.

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

     xmlRoot(x, ...)
     xmlRoot.XMLDocumentContent(x, ...)
     xmlRoot.XMLInternalDocument(x, ...)
     xmlRoot.HTMLDocument(x, ...)

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

       x: the object whose root/top-level XML node is to be returned.

     ...: arguments that are passed by the generic to the different
          specialized  methods of this generic.

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

     An object of class 'XMLNode'.

_N_o_t_e:

     One cannot obtain the parent or top-level node of an XMLNode
     object in S. This is different from  languages like C, Java, Perl,
     etc. and is primarily  because S does not provide support for
     references.

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

     'xmlTreeParse' '[[.XMLNode'

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

       doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
       xmlRoot(doc)

