getEncoding               package:XML               R Documentation

_D_e_t_e_r_m_i_n_e_s _t_h_e _e_n_c_o_d_i_n_g _f_o_r _a_n _X_M_L _d_o_c_u_m_e_n_t _o_r _n_o_d_e

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

     This function and its methods are intended to return the encoding
     of n XML . It is similar to 'Encoding' but currently restricted to
      XML nodes and documents.

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

     getEncoding(obj, ...)

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

     obj: the object whose encoding is being queried.

     ...: any additional parameters which can be customized by the
          methods.

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

     A character vector of length 1 giving the encoding of the XML
     document.

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

     Duncan Temple Lang

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

       f = system.file("exampleData", "charts.svg", package = "XML")
       doc = xmlParse(f)
       getEncoding(doc)
       n = getNodeSet(doc, "//g/text")[[1]]
       getEncoding(n)

       f = system.file("exampleData", "iTunes.plist", package = "XML")
       doc = xmlParse(f)
       getEncoding(doc)

