xmlNamespace               package:XML               R Documentation

_R_e_t_r_i_e_v_e _t_h_e _n_a_m_e_s_p_a_c_e _v_a_l_u_e _o_f _a_n _X_M_L _n_o_d_e.

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

     Each XML node has a namespace identifier which is a string
     indicating in which DTD (Document Type Definition) the definition
     of that element can be found.  This avoids the problem of having
     different document definitions using the same names for XML
     elements that have different meaning. To resolve the name space,
     i.e.  i.e. find out to where the identifier points, one can use
     the expression 'xmlNamespace(xmlRoot(doc))'.

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

     xmlNamespace(x)

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

       x: the object whose namespace is to be computed

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

     For non-root nodes, this returns a string giving the identifier of
     the name space for this node. For the root node, this returns a
     list with $3$ elements: 

      id: the identifier by which other nodes refer to this namespace.

     uri: the URI or location that defines this namespace.

   local: ? (can't remember off-hand).

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

     'xmlName' 'xmlChildren' 'xmlAttrs' 'xmlValue'

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

       doc <- xmlTreeParse(system.file("exampleData", "job.xml", package="XML"))
       xmlNamespace(xmlRoot(doc))
       xmlNamespace(xmlRoot(doc)[[1]][[1]])

       node <- xmlNode("arg", xmlNode("name", "foo"), namespace="R")
       xmlNamespace(node)

