parseXMLTree: Read an XML file into an R object

Description Usage Arguments Value See Also Examples

View source: R/parseXMLTree.R

Description

Read an XML file into an R object

Usage

1

Arguments

file

Character string, valid path to the XML file which should be parsed.

drop

Character vector with the possible values "comments", "cdata" "declarations" and "doctype", defining element classes to be dropped from the resulting object.

object

Logical, if TRUE, file will not be treated as a path name but as a character vector to be parsed as XML directly.

Value

An object of class XiMpLe.doc with four slots:

file:

Full path to the parsed file, or "object" if object=TRUE.

xml:

XML declaration, if found.

dtd:

Doctype definition, if found.

children:

A list of objects of class XiMpLe.node, with the elements "name" (the node name), "attributes" (list of attributes, if found), "children" (list of XiMpLe.node object, if found) and "value" (text value between a pair of start/end tags, if found).

See Also

XiMpLe.node, XiMpLe.doc

Examples

1
2
3
4
## Not run: 
sample.XML.object <- parseXMLTree("~/data/sample_file.xml")

## End(Not run)

XiMpLe documentation built on Dec. 13, 2017, 1:04 a.m.