From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Problems with xml-parse-string Date: Fri, 24 Sep 2010 00:21:49 +0200 Organization: Programmerer Ingebrigtsen Message-ID: References: <87pqw6d7nz.fsf@stupidchicken.com> <87zkvaiked.fsf@stupidchicken.com> <87vd5ymptn.fsf@stupidchicken.com> <87vd5x7ty2.fsf@stupidchicken.com> <87vd5wo48a.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285280533 20496 80.91.229.12 (23 Sep 2010 22:22:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2010 22:22:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 00:22:12 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 1OyuB8-00060Q-EK for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 00:22:10 +0200 Original-Received: from localhost ([127.0.0.1]:40914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyuB7-000377-Tc for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 18:22:09 -0400 Original-Received: from [140.186.70.92] (port=57147 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyuB1-00036i-4z for emacs-devel@gnu.org; Thu, 23 Sep 2010 18:22:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyuAx-0002ih-Lp for emacs-devel@gnu.org; Thu, 23 Sep 2010 18:22:03 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:55905) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyuAx-0002iN-CB for emacs-devel@gnu.org; Thu, 23 Sep 2010 18:21:59 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OyuAu-0005vn-6g for emacs-devel@gnu.org; Fri, 24 Sep 2010 00:21:56 +0200 Original-Received: from cm-84.215.34.171.getinternet.no ([84.215.34.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2010 00:21:56 +0200 Original-Received: from larsi by cm-84.215.34.171.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2010 00:21:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.34.171.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEX+2nTjt2BCJQ/+5H7+ 3Xf+13JR5uWJAAACPElEQVQ4jU2UQXbkIAxElRmxD+72fsxLDjAPDoCD2OM8dP+rpAS2Oyz9W4VU KppUtTVXc5csOMHOHsKDAKg5x43lBt8naKJZCCCVCZYQCmlDhZIKmVYO82xxSKljJoAl+BM8BtBG rokre7jOJtGkGr5CRb5u8IwARNqZOud6V2zRQG+tMbPkfINHTCbFaIoypPbwsaPT4PEd7RphkgE+ C8BW4pCCEtnMCe1+yDKUBqDWx9hRyvLvN3AoAKAkZX9PNuMzzQqoN0e9iNQVFdsFekzSq0CM6wbg 1+tyNvfYrtl9rp5jPIEK9zTW9LVBMJ7ArDJnjewLmi4xDdBd00x97LV6+VVBRMxjRNmhlC6AdVRs aZhyrKX8vQFRRUY6+j322iWWC7jmpififdcU5QIdrtt0Ug8vtcSSrjs4wyzKjF1saCvFc3ISl6tz NgV2BJdRUWZFc83meDPwfLWL6FQMmPlAMoeDp5RzTgnXyPoHcfaP14Ao6ja3P0I4bi24WxGpIq76 bwN+3j3uyDCesQxcvvgjygmQ3Ma9TeD9Hu8BKaMt5PCJO55v/82TNEB2Fi1Ye2By3dOcHcBh31Sz X5HdY1XBDidoTjF49t6jYtVS7n1gTXidvpqUswFnV66rLVBXPcLnof12F1HXzE69oEJ1TTMm1i45 yY0Ob1L+8bJE2byi9oYn+0qcpSS3zoIvNJ7ry12LbTd/8/WaTqmREJ5/JHjHaabBOkL+EU2OaXmP 8Y6oR781W6oLfnptPMYff2TdfefJD9cAAAAASUVORK5CYII= Mail-Copies-To: never X-Now-Playing: Various's _Harry Smith's Anthology of American Folk Music Volume Four (2)_: "Minnie Wallace - The Cockeyed World" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:Qx84hJHfo3do99amKXC7ai8lNZo= 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:130708 Archived-At: Chong Yidong writes: > The main differences in the "new" format are (i) listing attributes as > (:foo bar) inside the element list, rather than in an alist after the > element name, (ii) listing text as (text "foo") rather than "foo", and > (iii) the as-yet-unresolved issue with XML namespaces, which probably > needs to be fixed in xml.c. > > Point (i) is a broken design choice, as I already pointed out. Well, yes and no. Attributes are (:foo . bar). Nodes can (as you pointed out, and I didn't know) have names like :foo in XML, but they can't be (:foo . bar). They'll always have a list as the cdr. (They list may be nil, but it's still a list.) The main point of having the : before the attribute names is mainly an over-determination of what we're looking at when we're looking at stuff visually, as we have a tendency to do when we're trying to make heads or tails of the crappy HTML and XML people give us. 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. > As for (ii), it is a little nicer to take the cdr of each list member > without checking for stringp. If others thing this is a really good > change, I won't object, though it seems pretty trivial to me. It seems trivial, but as someone who's dealing with this stuff daily, I assure you that it's really really annoying never being able to say `assq' or just looping over the stuff without having the extra `if' everywhere. It's just annoying and makes the code unclear and error-prone. > We can add an optional flag to the xml-* functions to toggle between > the two representations. Yes, that would be fine by me. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen