Function: soap-xs-add-union

soap-xs-add-union is a byte-compiled function defined in soap-client.el.gz.

Signature

(soap-xs-add-union NODE TYPE)

Documentation

Add union members defined in XML NODE to TYPE, an soap-xs-simple-type.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-client.el.gz
(defun soap-xs-add-union (node type)
  "Add union members defined in XML NODE to TYPE, an `soap-xs-simple-type'."
  (cl-assert (eq (soap-l2wk (xml-node-name node)) 'xsd:union)
             nil
             "expecting xsd:union node, got %s"
             (soap-l2wk (xml-node-name node)))

  (setf (soap-xs-simple-type-base type)
        (mapcar #'soap-l2fq
                (split-string
                 (or (xml-get-attribute-or-nil node 'memberTypes) ""))))

  ;; Additional simple types can be defined inside the union node.  Add them
  ;; to the base list.  The "memberTypes" members will have to be resolved by
  ;; the "resolve-references" method, the inline types will not.
  (let (result)
    (dolist (simple-type (soap-xml-get-children1 node 'xsd:simpleType))
      (push (soap-xs-parse-simple-type simple-type) result))
    (setf (soap-xs-simple-type-base type)
          (append (soap-xs-simple-type-base type) (nreverse result)))))