coerceArgumentCode: Create R code to coerce an R value to a value appropriate for...

Description Usage Arguments Value Author(s) Examples

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

1

Arguments

id

the name of the variable to be coerced

type

the SchemaType-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

1
2
3
4
5
6
7
8
  tt = SchemaType("int", nsuri = "http://www.w3.org/2001/XMLSchema", obj = new("PrimitiveSchemaType"))
  coerceArgumentCode("x", tt)

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

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

sckott/XMLSchema documentation built on May 29, 2019, 3:46 p.m.