XMLCodeFile-class            package:XML            R Documentation

_S_i_m_p_l_e _c_l_a_s_s_e_s _f_o_r _i_d_e_n_t_i_f_y_i_n_g _a_n _X_M_L _d_o_c_u_m_e_n_t _c_o_n_t_a_i_n_i_n_g _R _c_o_d_e

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

     These two classes allow the user to identify an XML document or
     file as containing R code (amongst other content). Objects of
     either of these classes can then be passed to 'source' to read the
      code into R and also used in 'link{xmlSource}' to read just parts
     of it. 'XMLCodeFile' represents the file by its name; 'XMLCodeDoc'
     parses the contents of the file when the R object is created.
     Therefore, an 'XMLCodeDoc' is a snapshot of the contents at a
     moment in time while an 'XMLCodeFile' object re-reads the file
     each time and so reflects any "asynchronous" changes.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     One can create these objects using coercion methods, e.g
     'as("file/name", "XMLCodeFile")' or  'as("file/name",
     "XMLCodeDoc")'. One can also use  'xmlCodeFile'.

_S_l_o_t_s:


     '._D_a_t_a': Object of class '"character"'

_E_x_t_e_n_d_s:

     Class '"character"', from data part. Class '"vector"', by class
     "character", distance 2.

_M_e_t_h_o_d_s:


     [[ 'signature(x = "XMLCodeFile", i = "ANY", j = "ANY")':  this
          method allows one to retrieve/access an individual R code
          element in the XML document. This is typically done by
          specifying the value of the XML element's  "id" attribute.

     _c_o_e_r_c_e 'signature(from = "XMLCodeFile", to = "XMLCodeDoc")': parse
          the XML document from the "file" and treat the result as a
          'XMLCodeDoc' object. 

     _s_o_u_r_c_e 'signature(file = "XMLCodeFile")': read and evaluate all
          the R code in the XML document. For more control, use
          'xmlSource'.

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

     Duncan Temple Lang

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

     'xmlSource'

