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: whats the Emacsy way to xsltish tasks? Date: Fri, 20 May 2011 11:28:05 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1305888221 22847 80.91.229.12 (20 May 2011 10:43:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 May 2011 10:43:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 20 12:43:37 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QNNBB-0006Jc-L5 for ged-emacs-devel@m.gmane.org; Fri, 20 May 2011 12:43:37 +0200 Original-Received: from localhost ([::1]:51739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNNBB-0002LW-7C for ged-emacs-devel@m.gmane.org; Fri, 20 May 2011 06:43:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNNB7-0002LQ-Uk for emacs-devel@gnu.org; Fri, 20 May 2011 06:43:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNNB6-0002tt-MN for emacs-devel@gnu.org; Fri, 20 May 2011 06:43:33 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:45523 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNNB6-0002tn-Kg for emacs-devel@gnu.org; Fri, 20 May 2011 06:43:32 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id DA5044716; Fri, 20 May 2011 06:45:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=hOZUXlHwA5JQFCQC/lGzM22fdcw=; b=GxprNR jpGNEa5WVjUdQFDllPiiHN+0cwG/0qKCxD022KJY/i0tS+iMzCmJkOn/e8mRJ7iH BYFjyw6DoITHNKszIDaSjLvG3WBVVIDVChYt0P4n71iBT6g3ZJxUS2ZTP1Nf9tSS IOjSlI7BXC875xTP0o3DJCWn3FtWs0DSH5rJw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=cQjysNLw2AW5PT0BkMWR/o9csYSRFXF8 rSouIEM41ms4Ct+KCUsn6V7FiDa+e2k1zuNbCSH4MyRyWf4mqWkhjQohnW9ubTWG Ebys4LuSPlBdsgiQqvpe/sKq6HhwEoGI1GhXiqtkkasbGFp4HZa9Hcno4oYhMxbU Tv8LxnPIOCg= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id C85064713; Fri, 20 May 2011 06:45:37 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 31F854712; Fri, 20 May 2011 06:45:35 -0400 (EDT) In-Reply-To: (joakim@verona.se's message of "Fri, 20 May 2011 01:01:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 4C602CC6-82CE-11E0-BB66-BBB7F5B2FB1A-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139544 Archived-At: On Fri 20 May 2011 01:01, joakim@verona.se writes: > I have an elisp prog that builds an SVG image by using macros to create > xslt that then transforms an SVG to create another SVG. The solution > works but feels a bit humiliating. Why fork out to xsltproc, when xml is > lisp with brackets? > > Now I have a couple of similar projects, and I'd like to try some > different solution. Regexp matching is worse on these cases than forking > out to xsltproc, so the alternative is to parse the xml with the new > libxml wrapper, and transform it in Elisp. But since these are randomly > deep structures Elisp might die from stack asphyxiation during recursion. > > So what to do then? Implement tail elimination? wrap libxslt? Some other > embarassingly obvious solution I've missed? See Oleg Kiselyov's "pre-post-order" transformation combinator. He wrote a few papers on it. Andy -- http://wingolog.org/