Function: soap-inspect-xs-complex-type

soap-inspect-xs-complex-type is a byte-compiled function defined in soap-inspect.el.gz.

Signature

(soap-inspect-xs-complex-type TYPE)

Documentation

Insert information about TYPE in the current buffer.

TYPE is a soap-xs-complex-type.

Source Code

;; Defined in /usr/src/emacs/lisp/net/soap-inspect.el.gz
(defun soap-inspect-xs-complex-type (type)
  "Insert information about TYPE in the current buffer.
TYPE is a `soap-xs-complex-type'."
  (insert "Complex type: " (soap-element-fq-name type))
  (insert "\nKind: ")
  (cl-case (soap-xs-complex-type-indicator type)
    ((sequence all)
     (insert "a sequence ")
     (when (soap-xs-complex-type-base type)
       (insert "extending ")
       (soap-insert-describe-button (soap-xs-complex-type-base type)))
     (insert "\nAttributes: ")
     (dolist (attribute (soap-xs-complex-type-attributes type))
       (let ((name (or (soap-xs-attribute-name attribute) "*inline*"))
             (type (soap-xs-attribute-type attribute)))
         (insert "\n\t")
         (insert name)
         (insert "\t")
         (soap-insert-describe-button type)))
     (insert "\nElements: ")
     (let ((name-width 0)
           (type-width 0))
       (dolist (element (soap-xs-complex-type-elements type))
         (let ((name (or (soap-xs-element-name element) "*inline*"))
               (type (soap-xs-element-type element)))
           (setq name-width (max name-width (length name)))
           (setq type-width
                 (max type-width (length (soap-element-fq-name type))))))
       (setq name-width (+ name-width 2))
       (setq type-width (+ type-width 2))
       (dolist (element (soap-xs-complex-type-elements type))
         (let ((name (or (soap-xs-element-name element) "*inline*"))
               (type (soap-xs-element-type element)))
           (insert "\n\t")
           (insert name)
           (insert (make-string (- name-width (length name)) ?\ ))
           (soap-insert-describe-button type)
           (insert
            (make-string
             (- type-width (length (soap-element-fq-name type))) ?\ ))
           (when (soap-xs-element-multiple? element)
             (insert " multiple"))
           (when (soap-xs-element-optional? element)
             (insert " optional"))))))
    (choice
     (insert "a choice ")
     (when (soap-xs-complex-type-base type)
       (insert "extending ")
       (soap-insert-describe-button (soap-xs-complex-type-base type)))
     (insert "\nElements: ")
     (dolist (element (soap-xs-complex-type-elements type))
       (insert "\n\t")
       (soap-insert-describe-button element)))
    (array
     (insert "an array of ")
     (soap-insert-describe-button (soap-xs-complex-type-base type))))
  (insert "\nSample value:\n")
  (pp (soap-sample-value type) (current-buffer)))