xmlRoot {XML} | R Documentation |
These are a collection of methods for providing easy access to the
top-level XMLNode
object resulting from parsing an XML
document. They simplify accessing this node in the presence of
auxillary information such as DTDs, file name and version information
that is returned as part of the parsing.
xmlRoot(x, ...) xmlRoot.XMLDocumentContent(x, ...) xmlRoot.XMLInternalDocument(x, ...) xmlRoot.HTMLDocument(x, ...)
x |
the object whose root/top-level XML node is to be returned. |
... |
arguments that are passed by the generic to the different specialized methods of this generic. |
An object of class XMLNode
.
One cannot obtain the parent or top-level node of an XMLNode object in S. This is different from languages like C, Java, Perl, etc. and is primarily because S does not provide support for references.
Duncan Temple Lang
http://www.w3.org/XML, http://www.jclark.com/xml, http://www.omegahat.org
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML")) xmlRoot(doc)