diff options
| author | Thomas Fitzsimmons | 2019-07-24 04:54:31 -0400 |
|---|---|---|
| committer | Thomas Fitzsimmons | 2019-07-24 05:05:06 -0400 |
| commit | c92cccb4ebb032ad15148e3ac7af014c1bbc1653 (patch) | |
| tree | 60622fb2c6d5c0aafcf286f701391b305f52666f | |
| parent | a255caf19b9a3e45472d2a2d14fa8087eea838f1 (diff) | |
| download | emacs-c92cccb4ebb032ad15148e3ac7af014c1bbc1653.tar.gz emacs-c92cccb4ebb032ad15148e3ac7af014c1bbc1653.zip | |
soap-client: Encode simple type attributes
* lisp/net/soap-client.el (soap-encode-xs-simple-type-attributes):
Encode simple type attributes.
| -rw-r--r-- | lisp/net/soap-client.el | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 40c6e62500a..7d04cef6a89 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el | |||
| @@ -1352,14 +1352,25 @@ See also `soap-wsdl-resolve-references'." | |||
| 1352 | 1352 | ||
| 1353 | (defun soap-encode-xs-simple-type-attributes (value type) | 1353 | (defun soap-encode-xs-simple-type-attributes (value type) |
| 1354 | "Encode the XML attributes for VALUE according to TYPE. | 1354 | "Encode the XML attributes for VALUE according to TYPE. |
| 1355 | The xsi:type and an optional xsi:nil attributes are added. The | 1355 | The attributes are inserted in the current buffer at the current |
| 1356 | attributes are inserted in the current buffer at the current | 1356 | position. If TYPE has no attributes, the xsi:type attribute and |
| 1357 | position. | 1357 | an optional xsi:nil attribute are added. |
| 1358 | 1358 | ||
| 1359 | This is a specialization of `soap-encode-attributes' for | 1359 | This is a specialization of `soap-encode-attributes' for |
| 1360 | `soap-xs-simple-type' objects." | 1360 | `soap-xs-simple-type' objects." |
| 1361 | (insert " xsi:type=\"" (soap-element-fq-name type) "\"") | 1361 | (let ((attributes (soap-get-xs-attributes type))) |
| 1362 | (unless value (insert " xsi:nil=\"true\""))) | 1362 | (dolist (a attributes) |
| 1363 | (let ((element-name (soap-element-name a))) | ||
| 1364 | (if (soap-xs-attribute-default a) | ||
| 1365 | (insert " " element-name | ||
| 1366 | "=\"" (soap-xs-attribute-default a) "\"") | ||
| 1367 | (dolist (value-pair value) | ||
| 1368 | (when (equal element-name (symbol-name (car-safe value-pair))) | ||
| 1369 | (insert " " element-name | ||
| 1370 | "=\"" (cdr value-pair) "\"")))))) | ||
| 1371 | (unless attributes | ||
| 1372 | (insert " xsi:type=\"" (soap-element-fq-name type) "\"") | ||
| 1373 | (unless value (insert " xsi:nil=\"true\""))))) | ||
| 1363 | 1374 | ||
| 1364 | (defun soap-encode-xs-simple-type (value type) | 1375 | (defun soap-encode-xs-simple-type (value type) |
| 1365 | "Encode the VALUE according to TYPE. | 1376 | "Encode the VALUE according to TYPE. |