Learn R Programming

XML (version 3.99-0.20)

processXInclude: Perform the XInclude substitutions

Description

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.

Usage

processXInclude(node, flags = 0L)

Arguments

Value

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

References

libxml2 http://www.xmlsoft.org XInclude

See Also

xmlInternalTreeParse newXMLNode

Examples

Run this code

  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]])

Run the code above in your browser using DataLab