XMLInternalDocument-class {XML} | R Documentation

## Class to represent reference to C-level data structure for an XML document

### Description

This class is used to provide a handle/reference to a C-level data structure that contains the information from parsing parsing XML content. This leaves the nodes in the DOM or tree as C-level nodes rather than converting them to explicit R `XMLNode` objects. One can then operate on this tree in much the same way as one can the `XMLNode` representations, but we a) avoid copying the nodes to R, and b) can navigate the tree both down and up using `xmlParent` giving greater flexibility. Most importantly, one can use an `XMLInternalDocument` class object with an XPath expression to easily and relatively efficiently find nodes within a document that satisfy some criterion. See `getNodeSet`.

### Objects from the Class

Objects of this type are created via `xmlTreeParse` and `htmlTreeParse` with the argument `useInternalNodes` given as `TRUE`.

### Extends

Class `oldClass`, directly.

### Methods

### References

XPath

### See Also

`xmlTreeParse` `htmlTreeParse` `getNodeSet`

### Examples

     f = system.file("exampleData", "mtcars.xml", package="XML")
     doc = xmlTreeParse(f, useInternalNodes = TRUE)
     getNodeSet(doc, "//variables[@count]")
     getNodeSet(doc, "//record")

     getNodeSet(doc, "//record[@id='Mazda RX4']")

[Package XML version 1.7-1 Index]