Rev 7747 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{XMLInternalDocument-class}\docType{class}\alias{XMLAbstractDocument-class} %XXX put somewhere else.\alias{XMLInternalDocument-class}\alias{HTMLInternalDocument-class}\alias{coerce,XMLInternalNode,XMLInternalDocument-method}\alias{coerce,XMLInternalDocument,XMLInternalNode-method}\alias{coerce,XMLDocument,XMLInternalDocument-method}\title{Class to represent reference to C-level data structure for an XMLdocument}\description{This class is used to provide a handle/reference to a C-leveldata structure that contains the information from parsingparsing XML content.This leaves the nodes in the DOM or tree as C-level nodesrather than converting them to explicit R \code{XMLNode}objects. One can then operate on this tree in much the sameway as one can the \code{XMLNode} representations,but we a) avoid copying the nodes to R, and b) can navigatethe tree both down and up using \code{\link{xmlParent}}giving greater flexibility.Most importantly, one can use an \code{XMLInternalDocument}class object with an XPath expression to easily and relatively efficientlyfind nodes within a document that satisfy some criterion.See \code{\link{getNodeSet}}.}\section{Objects from the Class}{Objects of this type are created via\code{\link{xmlTreeParse}}and \code{\link{htmlTreeParse}}with the argument \code{useInternalNodes} given as \code{TRUE}.}\section{Extends}{Class \code{\linkS4class{oldClass}}, directly.}\section{Methods}{There are methods to serialize (dump) a document to a file or as astring, and to coerce it to a node by finding the top-level node ofthe document.There are functions to search the document for nodes specified byan XPath expression.}\references{XPath \url{https://www.w3.org/TR/xpath/}}\seealso{\code{\link{xmlTreeParse}}\code{\link{htmlTreeParse}}\code{\link{getNodeSet}}}\examples{f = system.file("exampleData", "mtcars.xml", package="XML")doc = xmlParse(f)getNodeSet(doc, "//variables[@count]")getNodeSet(doc, "//record")getNodeSet(doc, "//record[@id='Mazda RX4']")# free(doc)}\keyword{classes}