Function: soap-encode-xs-simple-type-attributes

soap-encode-xs-simple-type-attributes is a byte-compiled function defined in soap-client.el.gz.

Signature

(soap-encode-xs-simple-type-attributes VALUE TYPE)

Documentation

Encode the XML attributes for VALUE according to TYPE.

The attributes are inserted in the current buffer at the current position. If TYPE has no attributes, the xsi:type attribute and an optional xsi:nil attribute are added.

This is a specialization of soap-encode-attributes for soap-xs-simple-type objects.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-client.el.gz
(defun soap-encode-xs-simple-type-attributes (value type)
  "Encode the XML attributes for VALUE according to TYPE.
The attributes are inserted in the current buffer at the current
position.  If TYPE has no attributes, the xsi:type attribute and
an optional xsi:nil attribute are added.

This is a specialization of `soap-encode-attributes' for
`soap-xs-simple-type' objects."
  (let ((attributes (soap-get-xs-attributes type)))
    (dolist (a attributes)
      (let ((element-name (soap-element-name a)))
        (if (soap-xs-attribute-default a)
            (insert " " element-name
                    "=\"" (soap-xs-attribute-default a) "\"")
          (dolist (value-pair value)
            (when (equal element-name (symbol-name (car-safe value-pair)))
              (insert " " element-name
                      "=\"" (cdr value-pair) "\""))))))
    (unless attributes
      (insert " xsi:type=\"" (soap-element-fq-name type) "\"")
      (unless value (insert " xsi:nil=\"true\"")))))