From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: Problems with xml-parse-string Date: Fri, 24 Sep 2010 03:46:31 +0100 Message-ID: <4C9C1107.5010000@harpegolden.net> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285296409 5237 80.91.229.12 (24 Sep 2010 02:46:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 02:46:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 04:46:47 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 1OyyJA-0006Xc-5x for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 04:46:44 +0200 Original-Received: from localhost ([127.0.0.1]:33346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyyJ9-0005kT-M0 for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 22:46:43 -0400 Original-Received: from [140.186.70.92] (port=49416 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyyJ3-0005kE-V3 for emacs-devel@gnu.org; Thu, 23 Sep 2010 22:46:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyyJ0-0003hH-Ms for emacs-devel@gnu.org; Thu, 23 Sep 2010 22:46:38 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:51105) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyyJ0-0003h8-H9 for emacs-devel@gnu.org; Thu, 23 Sep 2010 22:46:34 -0400 Original-Received: from [87.198.54.160] (87-198-54-160.ptr.magnet.ie [87.198.54.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id 42F516839E for ; Fri, 24 Sep 2010 03:46:28 +0100 (IST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 In-Reply-To: <8739t03q2g.fsf@stupidchicken.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130724 Archived-At: On 24/09/10 02:09, Chong Yidong wrote: > Lars Magne Ingebrigtsen writes: > >> Stefan Monnier writes: >> >>>> As for the :foo node names, we can map them to anything else if >>>> required. Pick an invalid XML character -- any one will do, if this is >>>> important. >>> >>> How 'bout =foo ? >> >> Looks good to me. > > If we're going to make a clean break with the old xml.el parse tree > format, I think it makes more sense to go with sxml. Is there any > technical reason not to? I'm not too convinced mapping xml element and attribute names to interned lisp symbols at all is particularly desirable. Not that I personally use xml-... in emacs lisp much/ever, but I have used common lisp xml parsing in the past and seem to remember that using strings was overall less problematic than symbols (and it wasn't just down to case - common lisp only looks case insensitive), just generally easier to be non-lossy and non-cluttering-symbol-table-with-random-xml-crap. Read some transient xml message once? have some useless symbols hanging round forever (for small values of forever). Yes, strings look messier for "manually keyed in" toy example sexp representations of xml, but I imagine the bulk of emacs lisp xml api usage in practice would be programmatic. One could also accept symbols as a shortcut for lisp->xml and just use their symbol-names as strings, but output strings for xml->lisp. I suppose you could offer the option of interning for xml->lisp output. Over in common lisp land, the "xmls" supported (and extended a bit) by closure xml [1] used strings, avoiding symbols. [1] http://common-lisp.net/project/cxml/xmls-compat.html