From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Problems with xml-parse-string Date: Fri, 24 Sep 2010 12:26:21 -0400 Message-ID: <87pqw3nm4y.fsf@stupidchicken.com> References: <87pqw6d7nz.fsf@stupidchicken.com> <87zkvaiked.fsf@stupidchicken.com> <87vd5ymptn.fsf@stupidchicken.com> <87vd5x7ty2.fsf@stupidchicken.com> <87vd5wo48a.fsf@stupidchicken.com> <8739t03q2g.fsf@stupidchicken.com> <87k4mb2mfu.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285345667 3844 80.91.229.12 (24 Sep 2010 16:27:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 16:27:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 18:27:46 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzB7h-0005jI-AX for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 18:27:45 +0200 Original-Received: from localhost ([127.0.0.1]:37457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzB6c-0003rn-4N for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 12:26:38 -0400 Original-Received: from [140.186.70.92] (port=44313 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzB6S-0003pz-VD for emacs-devel@gnu.org; Fri, 24 Sep 2010 12:26:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzB6N-0000MW-5Y for emacs-devel@gnu.org; Fri, 24 Sep 2010 12:26:26 -0400 Original-Received: from pantheon-po24.its.yale.edu ([130.132.50.118]:35733) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzB6M-0000MC-Vi for emacs-devel@gnu.org; Fri, 24 Sep 2010 12:26:23 -0400 Original-Received: from furry (dhcp128036014154.central.yale.edu [128.36.14.154]) (authenticated bits=0) by pantheon-po24.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o8OGQLJs003426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Sep 2010 12:26:21 -0400 Original-Received: by furry (Postfix, from userid 1000) id 8E49C16D402; Fri, 24 Sep 2010 12:26:21 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Fri, 24 Sep 2010 17:53:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130786 Archived-At: Lars Magne Ingebrigtsen writes: > Chong Yidong writes: > >> (tag (@ (attr1 "value1") >> (attr2 "value2")) >> (nested "Text node") >> (empty)) >> >> This seems pretty regular to me. > > The main difference between sxml and xml.el output is that it has the > weird an unnecessary "@" node for the attributes and that it wastes a > cons in the attributes, isn't it? The xml.el output always has an alist for attributes after each tag; if there are no attributes, the element after the tag name is nil. In sxml, the `@' denotes an attribute list, which is omitted if no attributes exist. > Other than that it has the same problem that xml.el has, in that text > nodes have to be special-cased, so you can't say assq or use simple > descent without testing. It is illogical to criticize sxml for wasting conses, while arguing for wrapping each text node in a cons. Anyway, it is difficult to see how real the problem is without a concrete example. Could you provide one? I suspect that the real problem, if one exists, is Elisp's relatively weak support for list mapping and reduction; if that's the case, the correct solution is to pull in some of the relevant functions from the CL package.