comparison lisp/xml.el @ 98529:2a05b2390d45

(xml-parse-string): Use skip-chars-forward.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 05 Oct 2008 19:01:53 +0000
parents ee5932bf781d
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
98528:26654d8c83db 98529:2a05b2390d45
492 (xml-parse-string))))) 492 (xml-parse-string)))))
493 493
494 (defun xml-parse-string () 494 (defun xml-parse-string ()
495 "Parse the next whatever. Could be a string, or an element." 495 "Parse the next whatever. Could be a string, or an element."
496 (let* ((pos (point)) 496 (let* ((pos (point))
497 (string (progn (if (search-forward "<" nil t) 497 (string (progn (skip-chars-forward "^<")
498 (forward-char -1)
499 (goto-char (point-max)))
500 (buffer-substring-no-properties pos (point))))) 498 (buffer-substring-no-properties pos (point)))))
501 ;; Clean up the string. As per XML specifications, the XML 499 ;; Clean up the string. As per XML specifications, the XML
502 ;; processor should always pass the whole string to the 500 ;; processor should always pass the whole string to the
503 ;; application. But \r's should be replaced: 501 ;; application. But \r's should be replaced:
504 ;; http://www.w3.org/TR/2000/REC-xml-20001006#sec-line-ends 502 ;; http://www.w3.org/TR/2000/REC-xml-20001006#sec-line-ends