coerceArgumentCode         package:XMLSchema         R Documentation

_C_r_e_a_t_e _R _c_o_d_e _t_o _c_o_e_r_c_e _a_n _R _v_a_l_u_e _t_o _a _v_a_l_u_e _a_p_p_r_o_p_r_i_a_t_e _f_o_r _a_n
_X_M_L _S_c_h_e_m_a _t_y_p_e

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     coerceArgumentCode(id, type)

_A_r_g_u_m_e_n_t_s:

      id: the name of the variable to be coerced

    type: the 'SOAPType-class' describing the XML schema type expected. 

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_E_x_a_m_p_l_e_s:

       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)

