Function: soap-decode-array

soap-decode-array is a byte-compiled function defined in soap-client.el.gz.

Signature

(soap-decode-array NODE)

Documentation

Decode NODE as an Array using type information inside it.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-client.el.gz
(defun soap-decode-array (node)
  "Decode NODE as an Array using type information inside it."
  (let ((type (soap-xml-get-attribute-or-nil1 node 'soapenc:arrayType))
        (wtype nil)
        (contents (xml-node-children node))
        result)
    (when type
      ;; Type is in the format "someType[NUM]" where NUM is the number of
      ;; elements in the array.  We discard the [NUM] part.
      (setq type (replace-regexp-in-string "\\[[0-9]+\\]\\'" "" type))
      (setq wtype (soap-wsdl-get (soap-l2fq type)
                                 soap-current-wsdl 'soap-xs-type-p))
      (unless wtype
        ;; The node has type info encoded in it, but we don't know how to
        ;; decode it...
        (error "soap-decode-array: Node has unknown type: %s" type)))
    (dolist (e contents)
      (when (consp e)
        (push (if wtype
                  (soap-decode-type wtype e)
                (soap-decode-any-type e))
              result)))
    (nreverse result)))