Create an S-PLUS Object from a String or an XML File

DESCRIPTION:

This function parses a character string or a file containing the XML representation of an S-PLUS object and creates the appropriate S-PLUS object.

USAGE:

parseXML(parse, isFile)

REQUIRED ARGUMENTS:

parse
a character string containing either the name of an XML file or the XML representation an S-PLUS object.
isFile
a logical value. If TRUE, the argument parse is the name of a file containing the XML representation of an S-PLUS object. Otherwise, parse is the XML representation of an object.

VALUE:

an S-PLUS object as described by the XML representation in the input file or character string.

REFERENCES:

http://www.w3.org/XML

SEE ALSO:

, , , .

EXAMPLES:

# Creating and parsing an XML string
x <- list(1:32, LETTERS)
annotation <- "A list with hex coded numbers"
xml <- createXMLString(x, annotation, hex = T)
xx <- parseXML(xml, isFile=F)
identical(x, xx)   ## should return T

# Creating and parsing an XML file
x <- objects
filename <- "objects.xml"
annotation <- "The S-PLUS objects function"
xml <- createXMLFile(x, filename, annotation)
xx <- parseXML(filename, isFile=T)
all.equal(x, xx)   ## should return T