coerceArgumentCode {XMLSchema}R Documentation

Create R code to coerce an R value to a value appropriate for an XML Schema type

Description

This function is used to generate an R expression/command that will coerce an R value to another R value that corresponds to an XML schema type. The resulting value can then be serialized to XML, e.g. in a Web service (e.g. SSOAP) request

This function is used when programmatically generating R functions to interface to Web services and other facilities which involve serializing R values from users to XML.

Usage

coerceArgumentCode(id, type)

Arguments

id the name of the variable to be coerced
type the SOAPType-class describing the XML schema type expected.

Value

A string or R expression giving the R command to convert id.

Author(s)

Duncan Temple Lang

Examples

  tt = SOAPType("int", nsuri = "http://www.w3.org/2001/XMLSchema", obj = new("PrimitiveSOAPType"))
  coerceArgumentCode("x", tt)

  tt = SOAPType("string", nsuri = "http://www.w3.org/2001/XMLSchema", obj = new("PrimitiveSOAPType"))
  coerceArgumentCode("x", tt)

  tt = SOAPType("Hybrid", nsuri = "http://www.w3.org/2001/XMLSchema", obj = new("SOAPType"))
  coerceArgumentCode("x", tt)

[Package XMLSchema version 0.1-0 Index]