processXInclude             package:XML             R Documentation

_P_e_r_f_o_r_m _t_h_e _X_I_n_c_l_u_d_e _s_u_b_s_t_i_t_u_t_i_o_n_s

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

     This function and its methods process the XInclude directives
     within the document of the form '<xi:include href="..."
     xpointer=".."' and perform the actual substitution.

     These are only relevant for "internal nodes" as generated via
     'xmlInternalTreeParse' and 'newXMLNode' and their related
     functions. When dealing with XML documents via 'xmlTreeParse' or
     'xmlEventParse', the XInclude nodes are controlled during the
     parsing.

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

     processXInclude(node, flags = 0L)

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

    node: an XMLInternalDocument object or an XMLInternalElement node
          or a list of such internal nodes, e.g. returned from
          'xpathApply'.

   flags: an integer value that provides information to control how the
          XInclude substitutions are done, i.e. how they are parsed.
          This is a bitwise OR'ing of some or all of the
          xmlParserOption values. This will be turned into an enum in R
          in the future.

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

     These functions are used for their side-effect to modify the
     document and its nodes.

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

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     libxml2 <URL: http://www.xmlsoft.org> XInclude

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

     'xmlInternalTreeParse' 'newXMLNode'

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

       f = system.file("exampleData", "include.xml", package = "XML")
       doc = xmlInternalTreeParse(f, xinclude = FALSE)

       cat(saveXML(doc))
       sects = getNodeSet(doc, "//section")
       sapply(sects, function(x) xmlName(x[[2]]))
       processXInclude(doc)

       cat(saveXML(doc))

       f = system.file("exampleData", "include.xml", package = "XML")
       doc = xmlInternalTreeParse(f, xinclude = FALSE)
       section1 = getNodeSet(doc, "//section")[[1]]

          # process 
       processXInclude(section1[[2]])

