1 ;; -*- coding: utf-8-mcs-er -*-
2 (require 'cwiki-common)
8 (defun www-xml-format-props (props)
15 (setq key (symbol-name key)))
16 (if (eq (aref key 0) ?:)
17 (setq key (substring key 1)))
19 (format "%s %s=\"%s\""
21 (www-format-encode-string
22 (format "%s" val) 'without-tags))))
25 (defun www-xml-format-unit (format-unit)
26 (let (name props children ret)
28 ((stringp format-unit)
29 (mapconcat (lambda (c)
32 ;; ((eq c ?<) "&lt;")
33 ;; ((eq c ?>) "&gt;")
36 (www-format-encode-string format-unit 'without-tags)
40 (setq name (car format-unit)
41 props (nth 1 format-unit)
42 children (nthcdr 2 format-unit))
44 (setq ret (plist-get props :ref))
46 (setq props (plist-remprop (copy-list props) :ref))
48 (cons (list* 'ref nil ret)
51 (format "<%s%s>%s</%s>"
54 (www-xml-format-props props)
56 (www-xml-format-list children)
59 name (www-xml-format-props props)))
62 (format "%s" format-unit)))))
64 (defun www-xml-format-list (format-list)
65 (if (atom format-list)
66 (www-xml-format-unit format-list)
67 (mapconcat #'www-xml-format-unit
76 ;;; est-xml.el ends here