From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.bugs Subject: bug#20339: sxml simple: sxml->xml mishandles namespaces? Date: Mon, 4 Feb 2019 17:55:14 -0500 Message-ID: References: <20150415194714.GA30295@tuxteam.de> <87y45vln0f.fsf@pobox.com> <20160713132403.GA2349@tuxteam.de> <87furc1qeu.fsf@pobox.com> <87a7jbi8rx.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000073c594058119636f" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="30397"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 20339@debbugs.gnu.org To: Ricardo Wurmus Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Feb 04 23:59:32 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqnD9-0007nD-HX for guile-bugs@m.gmane.org; Mon, 04 Feb 2019 23:59:31 +0100 Original-Received: from localhost ([127.0.0.1]:50604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqnD8-0000C2-Fg for guile-bugs@m.gmane.org; Mon, 04 Feb 2019 17:59:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqn9r-00062m-32 for bug-guile@gnu.org; Mon, 04 Feb 2019 17:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqn9p-0002nv-P9 for bug-guile@gnu.org; Mon, 04 Feb 2019 17:56:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqn9n-0002ld-94 for bug-guile@gnu.org; Mon, 04 Feb 2019 17:56:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gqn9n-0004gj-7N for bug-guile@gnu.org; Mon, 04 Feb 2019 17:56:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: John Cowan Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 04 Feb 2019 22:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20339 X-GNU-PR-Package: guile Original-Received: via spool by 20339-submit@debbugs.gnu.org id=B20339.154932093417966 (code B ref 20339); Mon, 04 Feb 2019 22:56:03 +0000 Original-Received: (at 20339) by debbugs.gnu.org; 4 Feb 2019 22:55:34 +0000 Original-Received: from localhost ([127.0.0.1]:59857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqn9K-0004fi-80 for submit@debbugs.gnu.org; Mon, 04 Feb 2019 17:55:34 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:45143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqn9I-0004fT-58 for 20339@debbugs.gnu.org; Mon, 04 Feb 2019 17:55:33 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id q15so1644863wro.12 for <20339@debbugs.gnu.org>; Mon, 04 Feb 2019 14:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p6f67KqRUdU6E3bC/b3cXEtW5JAbEk+91l+ztTzDdwo=; b=RBMSXSaeWIYhikNG46EakI1+YbXb3Kj6tiT0h5C9ZVs4rX3WZixLtUtvKozcmy1bcU Outss4EZQIFjkEjIWz8YAGvFj5/MLab0vEPlrNDjozznySlWUngHXdZb7xOsafU4CE78 7ZSG/cI93XgIF5wkKQC7qD8afHjYnQaR4+7mN4nwB0kfTqMBO3Tcxyqd0KZwi8xnAijL NnyUwsxLXCE1C42oDBnyTBlk+tzflnD3wAd/WglRnfVXPXyV1oj2jS99Ntu4fqQRTRPQ i87B1cQnzENwu4FXsOzxCNhxNtpiD3yU4SLQ/oA63DcgGGQ4YCf8QuiuBiOCKgop64Hi 31Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p6f67KqRUdU6E3bC/b3cXEtW5JAbEk+91l+ztTzDdwo=; b=BdBo8yG0G1YOalKlctSbajdQZgcSs5gxa34tMNkh30w0VnfGFjM+gWRfa6w9MaGTED KgIcBLOAmRxIXgVrZr7sswm/dcVL67BZQdkAYT1QZFPCCNr3I6CHEqdtzVvGD1J1jG1X AOfa/4sY7WzH99+YvhCViVuyuOhLPgHXcLVgIZ2eoYcgAxuwhC/It1ORhczOp0S9IeKw F1jtRr0VNJ+tt7sKDWDyoEagdCj8Vv9l8lgDIrmwU1vDrOaQjSb1pao40SoKb2xdjpQj JJR8hQVBzVgk9+fhEfKZKP0Dt0pJt8zHV0tSKfABsBgVX+R+EEyy4tcCxjUbuHLpVU1w Tiuw== X-Gm-Message-State: AHQUAuZnv0sBQiTm79ThUx1WDF5GOatA0RQuoNPHuNv3Gj/bYthZ9uvw lxal/N5/LgIeNw8B9ST38tc9gW9foBFqNRGDSWG7qQ== X-Google-Smtp-Source: AHgI3IZ17fj5ok1cXdgK20K427VetXcFg57DGLwZ1Tblozmy5bPKBSP0u9BJKYAAtNZ9zW/vDjutehUQAgix5oU7lQk= X-Received: by 2002:a5d:5101:: with SMTP id s1mr1206131wrt.89.1549320926241; Mon, 04 Feb 2019 14:55:26 -0800 (PST) In-Reply-To: <87a7jbi8rx.fsf@elephly.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9299 Archived-At: --00000000000073c594058119636f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 4, 2019 at 3:45 PM Ricardo Wurmus wrote: \I changed name->sxml to use only the namespace aliases / abbreviations > instead of the namespace URIs. The trouble with that is that XML rnamespaces are lexically scoped, like Scheme local variables. It is perfectly valid to map a prefix to more than one URL, as long as the namespace declarations are in either disjoint or nested elements. So you don't know what the absolute name of the element or attribute is from just the prefix and the local part. Furthermore, it is also legal to define more than one prefix for the same URL, in which case names using either prefix are normally treated as equivalent (however, you can't have elements like ... even if a and b map to the same namespace). * Is the value for =E2=80=9Cnamespaces=E2=80=9D that=E2=80=99s passed in to= the > FINISH-ELEMENT procedure always the same? > > * Will the second return value of the final call to FINISH-ELEMENT > really always be the complete list of *all* namespaces that have been > encountered? > Definitely not, only the namespaces that are currently in scope. * Are there valid XML documents for which the match patterns to inject > namespace declarations would not apply? (e.g. documents with a PI > element and two separate XML trees) > That's not well-formed: you can only have a single element tree per XML document, although you can have any number of PIs, comments, and whitespace (which is normally ignored) before and after. --=20 John Cowan http://vrici.lojban.org/~cowan cowan@ccil.org If I have seen farther than others, it is because I was looking through a spyglass with my one good eye, with a parrot standing on my shoulder. --"Y" --00000000000073c594058119636f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Feb 4, 2019 = at 3:45 PM Ricardo Wurmus <rekado@= elephly.net> wrote:
<= br>
\I changed name-= >sxml to use only the namespace aliases / abbreviations
instead of the namespace URIs.

The trouble = with that is that XML rnamespaces are lexically scoped, like Scheme
local variables.=C2=A0 It is perfectly valid to map a prefix to more tha= n one URL,
as long as the namespace declarations are in either di= sjoint or nested
elements.=C2=A0 So you don't know what the a= bsolute name of the element
or attribute is from just the prefix = and the local part.

Furthermore, it is also legal = to define more than one prefix for
the same URL, in which case na= mes using either prefix are normally
treated as equivalent (howev= er, you can't have elements like <a:foo>...</b:foo>=C2=A0
even if a and b map to the same namespace).

* Is the value for =E2=80= =9Cnamespaces=E2=80=9D that=E2=80=99s passed in to the
=C2=A0 FINISH-ELEMENT procedure always the same?

* Will the second return value of the final call to FINISH-ELEMENT
=C2=A0 really always be the complete list of *all* namespaces that have bee= n
=C2=A0 encountered?

Definitely not, onl= y the namespaces that are currently in scope.=C2=A0

* Are there valid XML docume= nts for which the match patterns to inject
=C2=A0 namespace declarations would not apply?=C2=A0 (e.g. documents with a= PI
=C2=A0 element and two separate XML trees)

<= div>That's not well-formed: you can only have a single element tree per= XML
document, although you can have any number of PIs, comments,= and
whitespace (which is normally ignored) before and after.

--=C2=A0
John Cowan=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 http://vrici.l= ojban.org/~cowan=C2=A0 =C2=A0 =C2=A0 =C2=A0 cowan@ccil.org
If I have seen farther than others, it = is because I was looking through a
spyglass with my one good eye,= with a parrot standing on my shoulder. --"Y"
--00000000000073c594058119636f--