Create XML File Representation of an S-PLUS object

DESCRIPTION:

This function creates a file containing the XML representation of an S-PLUS object.

USAGE:

createXMLFile(x, file, annotation="", hex=F, as32bit=NULL, bigEndian=NULL,
        delimiter=NULL, precision=2)

ARGUMENTS:

x
the object to be converted into XML.
file
a character string giving the output file name.
annotation
a character string, the annotation containing any descriptive text.
hex
a logical value. If TRUE, numeric vectors are stored in hexadecimal.
as32bit
a logical value. If TRUE, numeric vectors are stored in as 32 bits. If FALSE, values are stored as 64 bits. If NULL (the default), values are stored according to the current machine. This argument is only relevant when hex=T.
bigEndian
a logical value. If TRUE, numeric vectors are stored in big endian format (the native byte order of Solaris). If FALSE, values are stored in little endian (the native byte format of Windows/Linux). If NULL (the default), values are stored according to the current machine. This argument is only relevant when hex=T.
delimiter
a character string. If non- NULL, vectors will be compressed as character delimited lists rather than as tag delimited lists.
precision
a integer value that defines the number of decimal places output by default XSL transformations.

VALUE:

Invisibly returns the input object x.

REFERENCES:

http://www.w3.org/XML

SEE ALSO:

,

EXAMPLES:

# Create an XML file containing a list
x <- list(fuel.frame, hist, c(1:50))
xmlfile <- "list.xml"
annotation <- "This is an example of createXMLFile usage"
precision <- 5
createXMLFile(x, xmlfile, annotation, precision=precision)

# Example showing more compressed output
x <- 1:10
xmlfile <- "vector.xml"
annotation <- "An example of createXMLFile usage with a more compressed output"
delimiter <- ","
createXMLFile(x, xmlfile, annotation, delimiter=delimiter)

# Example using hexadecimal output for numeric values
x <- 1:32
xmlfile <- "hexvector.xml"
annotation <- "An example of createXMLFile using hex output for numeric arrays"
createXMLFile(x, xmlfile, annotation, hex=T)