Transform an XML File

DESCRIPTION:

The javaXMLTransform function generates a formatted report from an XML file, or transforms one type of XML into another type. The functions xml2htm, xml2html , xml2pdf , xml2ps, xml2rtf , and xml2xml are convenience functions that call javaXMLTransform with the appropriate type specified.

USAGE:

javaXMLTransform(xmlFileName, outFileName, xslFileName=NULL, type="html",
   loggingLevel=2)
xml2htm(xmlFileName, outFileName, xslFileName=NULL)
xml2html(xmlFileName, outFileName, xslFileName=NULL)
xml2pdf(xmlFileName, outFileName, xslFileName=NULL, loggingLevel=2)
xml2ps(xmlFileName, outFileName, xslFileName=NULL, loggingLevel=2)
xml2rtf(xmlFileName, outFileName, xslFileName=NULL, loggingLevel=2)
xml2xml(xmlFileName, outFileName, xslFileName=NULL)

REQUIRED ARGUMENTS:

xmlFileName
name of the file containing the XML to transform. This will often be XML representing an S-PLUS object that was generated by the function.
outFileName
name of the new file to contain the generated XML or report.

OPTIONAL ARGUMENTS:

xslFileName
name of the XSLT or XSL:FO file describing how to transform the XML. An XSLT file is used for HTML or XML. An XSL:FO file is used for PDF, Postscript, or RTF. Standard XSLT and XSL:FO files for S-PLUS objects are in the $SHOME/library/SPXML/xml directory. If no xslFileName is specified, the standard SplusObjects.xsl file is used for HTML or XML, and SplusObjects_FO.xsl is used for other types.
type
type of file to create. The options are HTML, XML, PDF, PS, or RTF.
loggingLevel
the logging level controls how much logging information is printed to stdout. It is used for PDF, PS, and RTF, and may be deprecated if the implementation changes. Levels are DEBUG (0), INFO (1), WARN (2), ERROR (3), FATAL (4), and DISABLED (5).

VALUE:

no return value.

SIDE EFFECTS:

Creates a file.

DETAILS:

These functions use Java tools to perform XML transforms. XSLT is used to generate HTML or XML. XSL:FO is used to generate PDF, Postscript, or RTF.

Currently the HTML and XML transforms use classes in javax.xml.transform , the RTF transform uses classes in org.jfor, and the PDF and PS transforms use classes in org.apache.fop . The javax.xml.transform classes are standard JFC classes starting with JDK1.4, the org.jfor classes are available from www.jfor.org, and the org.apache.fop classes are available from www.apache.org. This implementation may change in the future as improved transformation tools become available.

These functions require a Java-enabled Spotfire S+. On Windows, Java can be enabled by loading the winjava library. On UNIX, Java can be enabled by using Splus -j or Splus -g to start Spotfire S+.

SEE ALSO:

EXAMPLES:

createXMLFile(fuel.frame, "my_fuel.xml")
xml2html("my_fuel.xml", "my_fuel.htm")
xml2pdf("my_fuel.xml", "my_fuel.pdf")