emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xml-parse-file and text properties


From: Richard Stallman
Subject: Re: xml-parse-file and text properties
Date: Thu, 20 Jul 2006 17:46:31 -0400

By the way, it looks like the function xml-parse-file
would be much cleaner if written like this.  Does this work?

(defun xml-parse-file (file &optional parse-dtd parse-ns)
  "Parse the well-formed XML file FILE.
If FILE is already visited, use its buffer and don't kill it.
Returns the top node with all its children.
If PARSE-DTD is non-nil, the DTD is parsed rather than skipped.
If PARSE-NS is non-nil, then QNAMES are expanded."
  (if (get-file-buffer file)
      (with-current-buffer (get-file-buffer file)
        (save-excursion
          (xml-parse-region (point-min)
                            (point-max)
                            (current-buffer)
                            parse-dtd parse-ns)))
    (with-temp-buffer
      (insert-file-contents file)
      (xml-parse-region (point-min)
                        (point-max)
                        (current-buffer)
                        parse-dtd parse-ns))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]