Function: soap-resolve-references-for-xs-element

soap-resolve-references-for-xs-element is a byte-compiled function defined in soap-client.el.gz.

Signature

(soap-resolve-references-for-xs-element ELEMENT WSDL)

Documentation

Replace names in ELEMENT with the referenced objects in the WSDL.

This is a specialization of soap-resolve-references for soap-xs-element objects.

See also soap-wsdl-resolve-references.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-client.el.gz
(defun soap-resolve-references-for-xs-element (element wsdl)
  "Replace names in ELEMENT with the referenced objects in the WSDL.
This is a specialization of `soap-resolve-references' for
`soap-xs-element' objects.

See also `soap-wsdl-resolve-references'."

  (let ((namespace (soap-element-namespace-tag element)))
    (when namespace
      (let ((nstag (car (rassoc namespace (soap-wsdl-alias-table wsdl)))))
        (when nstag
          (setf (soap-element-namespace-tag element) nstag)))))

  (let ((type (soap-xs-element-type^ element)))
    (cond ((soap-name-p type)
           (setf (soap-xs-element-type^ element)
                 (soap-wsdl-get type wsdl 'soap-xs-type-p)))
          ((soap-xs-type-p type)
           ;; an inline defined type, this will not be reached from anywhere
           ;; else, so we must resolve references now.
           (soap-resolve-references type wsdl))))
  (let ((reference (soap-xs-element-reference element)))
    (when (and (soap-name-p reference)
               ;; xsd:group reference nodes will be converted to inline types
               ;; by soap-resolve-references-for-xs-complex-type, so skip them
               ;; here.
               (not (soap-xs-element-is-group element)))
      (setf (soap-xs-element-reference element)
            (soap-wsdl-get reference wsdl 'soap-xs-element-p))))

  (let ((subst (soap-xs-element-substitution-group element)))
    (when (soap-name-p subst)
      (let ((target (soap-wsdl-get subst wsdl)))
        (if target
            (push element (soap-xs-element-alternatives target))
          (soap-warning "No target found for substitution-group" subst))))))