all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xml.el bug
@ 2004-10-07  1:06 Katsumi Yamaoka
  2004-10-07 17:58 ` Mark A. Hershberger
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2004-10-07  1:06 UTC (permalink / raw)


Hi,

I got an error while parsing BBC news using shimbun[1] and xml.el.
Here's a Lisp form which reproduces the same error as the case of
parsing the contents of:

http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml

(xml-substitute-special
 "The chief of Guinea-Bissau's army is killed by rebel soldiers in what is described as a "revolt" over unpaid wages.")

[1] Shimbun is a library, a part of emacs-w3m.

The backtrace is:

Debugger entered--Lisp error: (wrong-type-argument listp "\"")
  cadr("\"")
  (stringp (cadr expansion))
  (and (eq (length expansion) 1) (stringp (cadr expansion)))
  (if (and (eq ... 1) (stringp ...)) (setq children (concat prev-part expansion)) (if (stringp ...) (setq children ...) (setq children ...)))
  (cond ((null children) (if ... ... ...)) ((stringp children) (if ... ... ...)) ((and ... ...) (setcar children ...)) ((stringp expansion) (setq children ...)) ((stringp ...) (setcar children ...) (setq children ...)) (t (setq children ...)))
  (let* ((this-part ...) (prev-part ...) (entity ...) (expansion ...)) (cond (... ...) (... ...) (... ...) (... ...) (... ... ...) (t ...)) (setq point end-point))
  (while (string-match "&\\([^;]+\\);" string point) (setq end-point (match-end 0)) (let* (... ... ... ...) (cond ... ... ... ... ... ...) (setq point end-point)))
  (let ((point 0) children end-point) (while (string-match "&\\([^;]+\\);" string point) (setq end-point ...) (let* ... ... ...)) (cond (... ...) (... ...) (... string) (t ...)))
  xml-substitute-special("The chief of Guinea-Bissau's army is killed by rebel soldiers in what is described as a "revolt" over unpaid wages.")

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: xml.el bug
  2004-10-07  1:06 xml.el bug Katsumi Yamaoka
@ 2004-10-07 17:58 ` Mark A. Hershberger
  0 siblings, 0 replies; 2+ messages in thread
From: Mark A. Hershberger @ 2004-10-07 17:58 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1364 bytes --]


(Previous off-list reply said I had already checked in a fix for
this.  I was wrong.)

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> (xml-substitute-special "The chief of Guinea-Bissau's army is killed
> by rebel soldiers in what is described as a &quot;revolt&quot; over
> unpaid wages.")

The following patch backs out some changes I made to deal with xml
entities that expand into XML.  It should fix the problem till I can
get external entities to work.

--- xml.el	05 Oct 2004 20:48:38 -0400	1.37
+++ xml.el	07 Oct 2004 13:49:45 -0400	
@@ -727,14 +727,9 @@
 				(match-string 1 this-part)))))))
 
 	(cond ((null children)
-	       (if (and (eq (length expansion) 1)
-			(stringp (cadr expansion)))
-		   (setq children (concat prev-part expansion))
-		 (if (stringp (car expansion))
+	       ;; FIXME: If we have an entity that expands into XML, this won't work.
 		     (setq children
-			   (list (concat prev-part (car expansion))
-				 (append (cdr expansion))))
-		   (setq children (append expansion prev-part)))))
+		     (concat prev-part expansion)))
 	      ((stringp children)
 	       (if (stringp expansion)
 		   (setq children (concat children prev-part expansion))

-- 
A choice between one man and a shovel, or a dozen men with teaspoons
is clear to me, and I'm sure it is clear to you also.
    -- Zimran Ahmed <http://www.winterspeak.com/>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-07 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-07  1:06 xml.el bug Katsumi Yamaoka
2004-10-07 17:58 ` Mark A. Hershberger

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.