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

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

Signature

(soap-resolve-references-for-xs-attribute ATTRIBUTE WSDL)

Documentation

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

This is a specialization of soap-resolve-references for soap-xs-attribute 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-attribute (attribute wsdl)
  "Replace names in ATTRIBUTE with the referenced objects in the WSDL.
This is a specialization of `soap-resolve-references' for
`soap-xs-attribute' objects.

See also `soap-wsdl-resolve-references'."
  (let* ((type (soap-xs-attribute-type attribute))
         (reference (soap-xs-attribute-reference attribute))
         (predicate 'soap-xs-element-p)
         (xml-reference
          (and (soap-name-p reference)
               (equal (car reference) "http://www.w3.org/XML/1998/namespace"))))
    (cond (xml-reference
           ;; Convert references to attributes defined by the XML
           ;; schema (xml:base, xml:lang, xml:space and xml:id) to
           ;; xsd:string, to avoid needing to bundle and parse
           ;; xml.xsd.
           (setq reference '("http://www.w3.org/2001/XMLSchema" . "string"))
           (setq predicate 'soap-xs-basic-type-p))
          ((soap-name-p type)
           (setf (soap-xs-attribute-type attribute)
                 (soap-wsdl-get type wsdl
                                (lambda (type)
                                  (or (soap-xs-basic-type-p type)
                                      (soap-xs-simple-type-p type))))))
          ((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)))
    (when (soap-name-p reference)
      (setf (soap-xs-attribute-reference attribute)
            (soap-wsdl-get reference wsdl predicate)))))