From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: sxml simple, sxml->xml and namespaces Date: Tue, 21 Jun 2016 22:58:36 +0200 Message-ID: <87r3bquumb.fsf@pobox.com> References: <20150408205527.GA14675@tuxteam.de> <87mvmgjl1h.fsf@pobox.com> <87d1ncdtds.fsf@elephly.net> <87porchxfl.fsf@pobox.com> <87k2hi1dq5.fsf@elephly.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466542770 26976 80.91.229.3 (21 Jun 2016 20:59:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 20:59:30 +0000 (UTC) Cc: guile-devel@gnu.org To: Ricardo Wurmus Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jun 21 22:59:19 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFSlK-00016B-Tc for guile-devel@m.gmane.org; Tue, 21 Jun 2016 22:59:11 +0200 Original-Received: from localhost ([::1]:54226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFSlK-0005FM-8Z for guile-devel@m.gmane.org; Tue, 21 Jun 2016 16:59:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFSl1-0005Aw-M6 for guile-devel@gnu.org; Tue, 21 Jun 2016 16:58:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFSkv-0007WQ-Pv for guile-devel@gnu.org; Tue, 21 Jun 2016 16:58:50 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:63676 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFSkv-0007WK-IR for guile-devel@gnu.org; Tue, 21 Jun 2016 16:58:45 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 1B3C8259FA; Tue, 21 Jun 2016 16:58:45 -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:content-transfer-encoding; s=sasl; bh=Zk60OUPHz5dz /I7gRBdpsp+CmfM=; b=ZGfozrTumHZrqzF1LCLcGBfBfLT/CJu6nFrjeLLvMSaG hfdjaCkuKj8SXvjDG7r7uGWQadiXIUan7YWYdXCPv8ilmKWb+190QGNdsiUkPfkb QlBeEupQxbMjfP5lVFBUwUHru6k8jaoGOyc+TIJT0n3X5Du7Xquwnjcq2ffgS5E= 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:content-transfer-encoding; q=dns; s=sasl; b=NDlCRT 0leg5BGif7ZaMVZZsrN8Fi9s+NsiE55glwjq6wkTKhfMRhq/hWbqRfu6tJPLqvjW HCJpgfawRo/XnKvwvF+o4FuAAYq7S4qDjvvHPNsDRw5yy5jz6l/dxN7d2f7v+PnQ oIHUb5+yuI3O6Qynog4si/+YqFEviy0JHM1wM= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 12F04259F9; Tue, 21 Jun 2016 16:58:45 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 48473259F8; Tue, 21 Jun 2016 16:58:44 -0400 (EDT) In-Reply-To: <87k2hi1dq5.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 21 Jun 2016 22:36:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: F0E45EC8-37F2-11E6-88F2-C1836462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18384 Archived-At: Hi, On Tue 21 Jun 2016 22:36, Ricardo Wurmus writes: > This is the same patch I sent to the discussion of bug#20339 about a > year ago. Yeah sorry for the miscommunication; two lists, split brain. > The patch is not very ambitious: it only gives the user a way around the > error by letting them pass an alist of namespaces. The patched > =E2=80=9Csxml->xml=E2=80=9D does not attempt to be smart about anything. = It will still > fail if it encounters an undeclared namespace. This sounds fine to me to be honest. > ;; Define SVG document with namespaces > (define the-svg " xmlns:xlink=3D'http://www.w3.org/1999/xlink'> > stroke-width=3D'2' stroke=3D'purple' fill=3D'yellow' > id=3D'rect1' /> > ry=3D'5' rx=3D'8' stroke-width=3D'2' stroke=3D'purple' fill= =3D'blue' > xlink:href=3D'#rect1' /> > ") > > ;; Define alist of namespaces > (define ns '((svg . "http://www.w3.org/2000/svg") > (xlink . "http://www.w3.org/1999/xlink"))) > > ;; Convert to SXML, abbreviate namespaces according to ns alist > (define the-sxml (xml->sxml the-svg #:namespaces ns)) > > ;; Convert back to XML > (sxml->xml the-sxml #:namespaces ns) > > =3D> xmlns:xlink=3D"http://www.w3.org/1999/xlink"> > width=3D"20" > stroke-width=3D"2" > stroke=3D"purple" > id=3D"rect1" > height=3D"20" > fill=3D"yellow" /> > y=3D"5" x=3D"30" > width=3D"20" > stroke-width=3D"2" > stroke=3D"purple" > ry=3D"5" rx=3D"8" > height=3D"20" > fill=3D"blue" /> > This doesn't seem quite right to me, in the sense that it should be possible to specify default namespaces (i.e. xmlns=3D..., not requiring xmlns:svg=3D...). What do you think? The patch window is wide open :) Andy