comparison lisp/xml.el @ 106458:3b1d7962549d

Fixed Bug#5008.
author Ulf Jasper <ulf.jasper@web.de>
date Sun, 06 Dec 2009 18:13:19 +0000
parents a9dc0e7c3f2b
children 1d1d5d9bd884
comparison
equal deleted inserted replaced
106457:c15d1227e860 106458:3b1d7962549d
821 (concat (mapconcat 'identity 821 (concat (mapconcat 'identity
822 (nreverse children) 822 (nreverse children)
823 "") 823 "")
824 (substring string point)))))) 824 (substring string point))))))
825 825
826 (defun xml-substitute-numeric-entities (string)
827 "Substitute SGML numeric entities by their respective utf characters.
828 This function replaces numeric entities in the input STRING and
829 returns the modified string. For example \"&#42;\" gets replaced
830 by \"*\"."
831 (if (and string (stringp string))
832 (let ((start 0))
833 (while (string-match "&#\\([0-9]+\\);" string start)
834 (condition-case nil
835 (setq string (replace-match
836 (string (read (substring string
837 (match-beginning 1)
838 (match-end 1))))
839 nil nil string))
840 (error nil))
841 (setq start (1+ (match-beginning 0))))
842 string)
843 nil))
844
826 ;;******************************************************************* 845 ;;*******************************************************************
827 ;;** 846 ;;**
828 ;;** Printing a tree. 847 ;;** Printing a tree.
829 ;;** This function is intended mainly for debugging purposes. 848 ;;** This function is intended mainly for debugging purposes.
830 ;;** 849 ;;**