Function: soap-xs-add-list

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

Signature

(soap-xs-add-list NODE TYPE)

Documentation

Add list defined in XML NODE to TYPE, a soap-xs-simple-type.

Source Code

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

  ;; A simple type can be defined inline inside the list node or referenced by
  ;; the itemType attribute, in which case it will be resolved by the
  ;; resolve-references method.
  (let* ((item-type (xml-get-attribute-or-nil node 'itemType))
         (children (soap-xml-get-children1 node 'xsd:simpleType)))
    (if item-type
        (if (= (length children) 0)
            (setf (soap-xs-simple-type-base type) (soap-l2fq item-type))
          (soap-warning
           "xsd:list node with itemType has more than zero children: %s"
           (soap-xs-type-name type)))
      (if (= (length children) 1)
          (setf (soap-xs-simple-type-base type)
                (soap-xs-parse-simple-type
                 (car (soap-xml-get-children1 node 'xsd:simpleType))))
        (soap-warning "xsd:list node has more than one child %s"
                      (soap-xs-type-name type))))
    (setf (soap-xs-simple-type-is-list type) t)))