From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.emacs.devel Subject: Re: Problems with xml-parse-string Date: Sat, 25 Sep 2010 16:42:29 +0200 Message-ID: References: <87zkvaiked.fsf@stupidchicken.com> <87vd5ymptn.fsf@stupidchicken.com> <87vd5x7ty2.fsf@stupidchicken.com> <87vd5wo48a.fsf@stupidchicken.com> <8739t03q2g.fsf@stupidchicken.com> <87k4mb2mfu.fsf@stupidchicken.com> <87pqw3nm4y.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285425578 23461 80.91.229.12 (25 Sep 2010 14:39:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 14:39:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 16:39:35 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 1OzVuY-0007p2-Tf for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 16:39:35 +0200 Original-Received: from localhost ([127.0.0.1]:36071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzVuY-0005Db-3K for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 10:39:34 -0400 Original-Received: from [140.186.70.92] (port=40621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzVuO-0005A9-7z for emacs-devel@gnu.org; Sat, 25 Sep 2010 10:39:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzVuJ-0007KE-QW for emacs-devel@gnu.org; Sat, 25 Sep 2010 10:39:24 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:37463 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzVuJ-0007K7-Mi for emacs-devel@gnu.org; Sat, 25 Sep 2010 10:39:19 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 16D56D9E2D for ; Sat, 25 Sep 2010 10:39:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ewNH6EzlKK108QTNFcrh8bbeBtI=; b=iIDfDc WIp39JY7mLIMlLAk5Ni0VBQ194nSl2dZ3FkYwPPYHgfJvlnnlnPe4RtLZwNQsXgd bHTwWSYYdwnqa0jLwzFwCPMuQ52rs0PsXDqlJ6wl57iOXHXiHeh1Pe8M5ESzeWA2 ElXT+gt3ru3UCInk41hBtVmaZ8NVS0aKRotGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=bAv1HL7fkOvMdmEhVFk/ffD2MG0aZyP5 mSvVrHjfaCYSFp9m9/04F5raEer8bL4dB/VtVEXQRO4g5xqTMxwRIrNqyskxZwVi jz0I96aXPwKnEPQZ21E+T9F44Xk3HCSHtX8kw/9d3MH16J3O8nEFGd50sDEHrh2L 3Nf6/LIp3U0= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 11BC3D9E2C for ; Sat, 25 Sep 2010 10:39:19 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [88.17.207.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id C48BDD9E2B for ; Sat, 25 Sep 2010 10:39:17 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Fri, 24 Sep 2010 18:46:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: ADD22EC2-C8B2-11DF-95B0-030CEE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:130846 Archived-At: Hello, On Fri 24 Sep 2010 18:46, Lars Magne Ingebrigtsen writes: > To take a concrete example: You want the src of the img node you have. > > xml.el: (cdr (assq 'img (cadr node))) > sxml.el: (if (and (consp (cadr node)) > (eq (caadr node) '@)) > (cadr (assq 'img node))) You should use something like sxml-match. http://www.gnu.org/software/guile/docs/master/guile.html/sxml_002dmatch.html#sxml_002dmatch (sxml-match node ((img (@ (src ,src))) src)) A bit verbose for this particular example, but it's the best, most robust way to parse out values from xml-in-s-expressions. Andy -- http://wingolog.org/