CreateXmlString: Inserting CDATA into XML-templates of NEOS

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/CreateXmlString.R

Description

With this function the information for XML-templates can be inserted. Ordinarily, one creates an object with the function NgetSolverTemplate() first and then inserts the requested CDATA fields of this XML-form with this function.

Usage

1
CreateXmlString(neosxml, cdatalist)

Arguments

neosxml

An object of class NeosXml created with the function NgetSolverTemplate().

cdatalist

A named list object with the CDATA tags to be filled.

Value

A character string containing the specified optimization problem, which can then be used in a call to NsubmitJob().

Author(s)

Bernhard Pfaff

References

NEOS API: http://neos-guide.org/content/NEOS-API,
Omegahat web site for RCurl: http://www.omegahat.net/RCurl,
Omegahat web site for XMLRPC: http://www.omegahat.net/XMLRPC

See Also

NeosXml and NgetSolverTemplate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

tmp <-NgetSolverTemplate(category = "go", solvername = "ASA",
inputMethod = "AMPL")
## setting path to example model and data file
modf <- system.file("ExAMPL", "diet.mod", package = "rneos")
datf <- system.file("ExAMPL", "diet.dat", package = "rneos")
## import of file contents
modc <- paste(paste(readLines(modf), collapse = "\n"), "\n")
cat(modc)
datc <- paste(paste(readLines(datf), collapse = "\n"), "\n")
cat(datc)
## create list object
argslist <- list(model = modc, data = datc, commands = "",
comments = "")
## create XML string
xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist)
xmls

## End(Not run)

rneos documentation built on May 31, 2017, 3:11 a.m.

Related to CreateXmlString in rneos...