Function: soap-xs-parse-simple-type

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

Signature

(soap-xs-parse-simple-type NODE)

Documentation

Construct an soap-xs-simple-type object from the XML NODE.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-client.el.gz
(defun soap-xs-parse-simple-type (node)
  "Construct an `soap-xs-simple-type' object from the XML NODE."
  (cl-assert (memq (soap-l2wk (xml-node-name node))
                   '(xsd:simpleType xsd:simpleContent))
             nil
             "expecting xsd:simpleType or xsd:simpleContent node, got %s"
             (soap-l2wk (xml-node-name node)))

  ;; NOTE: name can be nil for inline types.  Such types cannot be added to a
  ;; namespace.
  (let ((name (xml-get-attribute-or-nil node 'name))
        (id (xml-get-attribute-or-nil node 'id)))

    (let ((type (make-soap-xs-simple-type
                 :name name :namespace-tag soap-target-xmlns :id id))
          (def (soap-xml-node-find-matching-child
                node '(xsd:restriction xsd:extension xsd:union xsd:list))))
      (cl-ecase (soap-l2wk (xml-node-name def))
        (xsd:restriction (soap-xs-add-restriction def type))
        (xsd:extension (soap-xs-add-extension def type))
        (xsd:union (soap-xs-add-union def type))
        (xsd:list (soap-xs-add-list def type)))

      type)))