From abc5f85d17daa03e13363ab6a3eac6575fb6a4bc Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 6 Dec 2010 19:10:38 +0900 Subject: [PATCH] (www-xml-format-props): Moved to est-xml.el. (www-xml-format-unit): Ditto. (www-xml-format-list): Ditto. --- cwiki-common.el | 66 ------------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 5e0a846..aad731d 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -1192,72 +1192,6 @@ nil without-tags without-edit))) -;;; @ XML generator -;;; - -(defun www-xml-format-props (props) - (let ((dest "") - key val) - (while props - (setq key (pop props) - val (pop props)) - (if (symbolp key) - (setq key (symbol-name key))) - (if (eq (aref key 0) ?:) - (setq key (substring key 1))) - (setq dest - (format "%s %s=\"%s\"" - dest key - (www-format-encode-string - (format "%s" val) 'without-tags)))) - dest)) - -(defun www-xml-format-unit (format-unit) - (let (name props children ret) - (cond - ((stringp format-unit) - (mapconcat (lambda (c) - (cond - ((eq c ?&) "&") - ;; ((eq c ?<) "&lt;") - ;; ((eq c ?>) "&gt;") - (t - (char-to-string c)))) - (www-format-encode-string format-unit 'without-tags) - "") - ) - ((consp format-unit) - (setq name (car format-unit) - props (nth 1 format-unit) - children (nthcdr 2 format-unit)) - (when (eq name 'link) - (setq ret (plist-get props :ref)) - (unless (stringp ret) - (setq props (plist-remprop (copy-list props) :ref)) - (setq children - (cons (list* 'ref nil ret) - children)))) - (if children - (format "<%s%s>%s" - name - (if props - (www-xml-format-props props) - "") - (www-xml-format-list children) - name) - (format "<%s%s/>" - name (www-xml-format-props props))) - ) - (t - (format "%s" format-unit))))) - -(defun www-xml-format-list (format-list) - (if (atom format-list) - (www-xml-format-unit format-list) - (mapconcat #'www-xml-format-unit - format-list ""))) - - ;;; @ HTML generator ;;; -- 1.7.10.4