chickadee » xml-rpc » xml-rpc-unparsers

xml-rpc-unparsers #!optional alistparameter

This parameter controls how Scheme values are encoded into XML-RPC values. The keys of this alist are predicate procedures, the values are conversion procedures. If the predicate procedure returns true for its argument, it's a datatype that will be converted to SXML by the matching conversion procedure.

Defaults to:

`((,vector? . ,vector->xml-rpc-array)
  (,(conjoin number? exact?) . ,number->xml-rpc-int)
  (,number? . ,number->xml-rpc-double)
  (,boolean? . ,boolean->xml-rpc-boolean)
  (,string? . ,->xml-rpc-string)
  (,symbol? . ,->xml-rpc-string)
  (,u8vector? . ,u8vector->xml-rpc-base64)
  (,blob? . ,blob->xml-rpc-base64)
  (,hash-table? . ,hash-table->xml-rpc-struct)
  ;; see below for an explantation of this predicate
  (,nonempty-symbol-keyed-alist? . ,alist->xml-rpc-struct)
  (,list? . ,list->xml-rpc-array))

Order matters in this alist; the converter corresponding to the first predicate returning a true value is used.

The SXML returned by these conversion procedures is the element inside the value element.

(use xml-rpc-lolevel)

(number->xml-rpc-int 1)
(i4 "1")