Learn R Programming

XML (version 3.99-0.16.1)

replaceNodeWithChildren: Replace an XML node with it child nodes

Description

This function can be used to flatten parts of an XML tree. This takes a node and removes itself from the tree, but places its kids in it place.

Usage

replaceNodeWithChildren(node)

Value

NULL. The purpose of this function is to modify the internal document.

Arguments

node

an XMLInternalNode object

Author

Duncan Temple Lang

References

libxml2 documentation.

Examples

Run this code
doc = xmlParse('
                 
                  A
                  B
                  C
                 
                 
                  D
                  E
                  F
                 
                ')

pages = getNodeSet(doc, "//page")
invisible(lapply(pages, replaceNodeWithChildren))
doc

Run the code above in your browser using DataLab