From unknown Sun Jun 22 00:45:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63740: broken and questionable attribute normalisation in xml.el Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 May 2023 15:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63740 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 63740@debbugs.gnu.org Cc: Juanma Barranquero , "Mark A. Hershberger" X-Debbugs-Original-To: Emacs Bug Report Received: via spool by submit@debbugs.gnu.org id=B.168511410717299 (code B ref -1); Fri, 26 May 2023 15:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 May 2023 15:15:07 +0000 Received: from localhost ([127.0.0.1]:50562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Z9n-0004Ux-DX for submit@debbugs.gnu.org; Fri, 26 May 2023 11:15:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:37916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Z9l-0004Up-4j for submit@debbugs.gnu.org; Fri, 26 May 2023 11:15:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2Z9g-0007zG-AZ for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 11:15:01 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2Z9d-0008En-0B for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 11:14:58 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso970952e87.3 for ; Fri, 26 May 2023 08:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685114094; x=1687706094; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Nkmc0swKyz3YQKMcCnJCaKO0Ia1xqH63V5DlpdFKOms=; b=Jh4xNmzOL91uWVT7+wO93pLqpmnrzkdR4iXfsRiIox8Uf4oqjNgLpyP8ybuWOwdaFX CcMpsx9rzw7JCzo/rzH2KZPWXIw5rh19qlQiCIHOYkXOfUMdHFAZFuL4TI5zawuAyGu5 gjJhe//1J60UmXxroM6JbGUtcG+6n9kHojmqlFY1ZHfmbbxfB6P3vFb+Du3MgTyU7Zzn KZSjuhfAjHcrI7HuLttVzqenBDmWS8z0JEM4V8OEIjfl/ckKg57l7DhNKjRoGN4wNK/2 h5eQzhEmvMXX2U8vJKixGzeglquytqGB2jCK1tqwN2jci3FpRa5yRyrdNl/1+a7HtJ2P l5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685114094; x=1687706094; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nkmc0swKyz3YQKMcCnJCaKO0Ia1xqH63V5DlpdFKOms=; b=i+Bg0EgBUBcKel+097xDEBhiq5g9wkKmcfemNZWVluww5es52p3UM8seIduDl4lxSy fOf/cgd2+uvtUN7163ok1JNMky7NiCbO5QxuwQYQWfBKML4qg+xhIQL2VAZudDCfKeF8 ZcMzlFxXqVqD5UyH04zixFG6oyn8bNDF7cQhE0znLl4xZEbtxeIwKr6pmuTtEdMGp9/e +7AyeC1XnO+hXaDgC/IklwrOTiuSkaNMcXal8/x+sVyl02Ig/p0ynUrU+Jjyx2jMzckz mB+Yc5al1CFhrXGwhd4DbwTSRiyQVq58eT3lnByppoUZZvCC4wtRE0aow11UUkbjzElG X5DA== X-Gm-Message-State: AC+VfDwpI143fa4Jw4GDfy2xk37kteaqtjYUvaHpYjUq5yk8BJQYv7bV ZCofqnxy66shkQ5kOxA5VkaLqgXpdPg= X-Google-Smtp-Source: ACHHUZ4MuFzgDjtp+KHn/LvSQmy8FhSxuKyXHaXik5Tyh0f3Il1Dt7xAxsS2XNTG1EOhZlLm+vigng== X-Received: by 2002:a05:6512:24c:b0:4f3:8507:d90d with SMTP id b12-20020a056512024c00b004f38507d90dmr622884lfo.34.1685114094297; Fri, 26 May 2023 08:14:54 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id d10-20020ac25eca000000b004f3778239adsm669623lfq.19.2023.05.26.08.14.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2023 08:14:53 -0700 (PDT) From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Message-Id: <48DF5E96-D7EF-46A7-877A-D6EA64E6DB3E@gmail.com> Date: Fri, 26 May 2023 17:14:53 +0200 X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In `xml-parse-attlist`, we see: ;; Multiple whitespace characters should be replaced with a single = one ;; in the attributes (let ((string (match-string-no-properties 1))) (replace-regexp-in-string "\\s-\\{2,\\}" " " string) ... The call to `replace-regexp-in-string` is of course useless and there is = now a compiler warning telling us, which is how this came to light. However, should we really collapse whitespace here? If I'm reading the = spec correctly, it's not done for CDATA attributes and we have no reason = to believe any other type, do we? I'm no XML expert but it looks like the code is correct and we can just = remove the call to `replace-regexp-in-string` (and the misleading = comment). Or? From unknown Sun Jun 22 00:45:09 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Subject: bug#63740: closed (bug#63740: broken and questionable attribute normalisation in xml.el) Message-ID: References: <58A527AB-79B2-4E11-9049-35049F1EA417@acm.org> <48DF5E96-D7EF-46A7-877A-D6EA64E6DB3E@gmail.com> X-Gnu-PR-Message: they-closed 63740 X-Gnu-PR-Package: emacs Reply-To: 63740@debbugs.gnu.org Date: Tue, 30 May 2023 15:51:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1685461862-9921-1" This is a multi-part message in MIME format... ------------=_1685461862-9921-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63740: broken and questionable attribute normalisation in xml.el which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63740@debbugs.gnu.org. --=20 63740: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63740 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1685461862-9921-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63740-done) by debbugs.gnu.org; 30 May 2023 15:50:12 +0000 Received: from localhost ([127.0.0.1]:33926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q41bw-0002Yp-FD for submit@debbugs.gnu.org; Tue, 30 May 2023 11:50:12 -0400 Received: from mail232c50.megamailservers.eu ([91.136.10.242]:33522 helo=mail37c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q41bq-0002Ya-TH for 63740-done@debbugs.gnu.org; Tue, 30 May 2023 11:50:11 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1685461804; bh=LZqrvjSv6rvZzNgVQdCOz9IuxuJdbx32hJWVdHQzyzE=; h=From:Subject:Date:To:From; b=MrvSs5ZjIeoPJn0AdVdZNP2e1pJckn710VMwG+viygYlI1CAN3o4gVzYaZaukskMe s8z2XvilIvvMbR9DdqT/BSnRE9ULrWNyr9LVhUEFP8OvIqnfRBnN3ZAylyyQ16r0KB cO6mWVxJJRgTlRLd3iy6WKiYb2BOZHTxSc2CG3t4= Feedback-ID: mattiase@acm.or Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se [188.150.165.235]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 34UFo27j079930 for <63740-done@debbugs.gnu.org>; Tue, 30 May 2023 15:50:04 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: bug#63740: broken and questionable attribute normalisation in xml.el Message-Id: <58A527AB-79B2-4E11-9049-35049F1EA417@acm.org> Date: Tue, 30 May 2023 17:50:01 +0200 To: 63740-done@debbugs.gnu.org X-Mailer: Apple Mail (2.3654.120.0.1.15) X-VADE-SPAMSTATE: clean X-VADE-SPAMSCORE: 0 X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekjedgleduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffquffvqffrkfetpdfqfgfvpdfgpfggqdevhedtnecuuegrihhlohhuthemuceftddunecunecujfgurhephfgtgfgguffkfffvofesthhqmhdthhdtvdenucfhrhhomhepofgrthhtihgrshcugfhnghguvghgnohrugcuoehmrghtthhirghsvgesrggtmhdrohhrgheqnecuggftrfgrthhtvghrnhepteegieetgeefvedvvdduffeftdfgjeefhfeuhedvfeduteeiieelleeuffefleelnecukfhppedukeekrdduhedtrdduieehrddvfeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudekkedrudehtddrudeihedrvdefhedphhgvlhhopehsmhhtphgtlhhivghnthdrrghpphhlvgdpmhgrihhlfhhrohhmpehmrghtthhirghsvgesrggtmhdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopeeifeejgedtqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrgh X-Origin-Country: SE X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 63740-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I decided that the attempt to collapse whitespace in attributes is wrong = and removed the ineffective attempt to do so in 9ae212fb1e. Bug closed. ------------=_1685461862-9921-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 May 2023 15:15:07 +0000 Received: from localhost ([127.0.0.1]:50562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Z9n-0004Ux-DX for submit@debbugs.gnu.org; Fri, 26 May 2023 11:15:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:37916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Z9l-0004Up-4j for submit@debbugs.gnu.org; Fri, 26 May 2023 11:15:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2Z9g-0007zG-AZ for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 11:15:01 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2Z9d-0008En-0B for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 11:14:58 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso970952e87.3 for ; Fri, 26 May 2023 08:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685114094; x=1687706094; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Nkmc0swKyz3YQKMcCnJCaKO0Ia1xqH63V5DlpdFKOms=; b=Jh4xNmzOL91uWVT7+wO93pLqpmnrzkdR4iXfsRiIox8Uf4oqjNgLpyP8ybuWOwdaFX CcMpsx9rzw7JCzo/rzH2KZPWXIw5rh19qlQiCIHOYkXOfUMdHFAZFuL4TI5zawuAyGu5 gjJhe//1J60UmXxroM6JbGUtcG+6n9kHojmqlFY1ZHfmbbxfB6P3vFb+Du3MgTyU7Zzn KZSjuhfAjHcrI7HuLttVzqenBDmWS8z0JEM4V8OEIjfl/ckKg57l7DhNKjRoGN4wNK/2 h5eQzhEmvMXX2U8vJKixGzeglquytqGB2jCK1tqwN2jci3FpRa5yRyrdNl/1+a7HtJ2P l5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685114094; x=1687706094; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nkmc0swKyz3YQKMcCnJCaKO0Ia1xqH63V5DlpdFKOms=; b=i+Bg0EgBUBcKel+097xDEBhiq5g9wkKmcfemNZWVluww5es52p3UM8seIduDl4lxSy fOf/cgd2+uvtUN7163ok1JNMky7NiCbO5QxuwQYQWfBKML4qg+xhIQL2VAZudDCfKeF8 ZcMzlFxXqVqD5UyH04zixFG6oyn8bNDF7cQhE0znLl4xZEbtxeIwKr6pmuTtEdMGp9/e +7AyeC1XnO+hXaDgC/IklwrOTiuSkaNMcXal8/x+sVyl02Ig/p0ynUrU+Jjyx2jMzckz mB+Yc5al1CFhrXGwhd4DbwTSRiyQVq58eT3lnByppoUZZvCC4wtRE0aow11UUkbjzElG X5DA== X-Gm-Message-State: AC+VfDwpI143fa4Jw4GDfy2xk37kteaqtjYUvaHpYjUq5yk8BJQYv7bV ZCofqnxy66shkQ5kOxA5VkaLqgXpdPg= X-Google-Smtp-Source: ACHHUZ4MuFzgDjtp+KHn/LvSQmy8FhSxuKyXHaXik5Tyh0f3Il1Dt7xAxsS2XNTG1EOhZlLm+vigng== X-Received: by 2002:a05:6512:24c:b0:4f3:8507:d90d with SMTP id b12-20020a056512024c00b004f38507d90dmr622884lfo.34.1685114094297; Fri, 26 May 2023 08:14:54 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id d10-20020ac25eca000000b004f3778239adsm669623lfq.19.2023.05.26.08.14.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2023 08:14:53 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: broken and questionable attribute normalisation in xml.el Message-Id: <48DF5E96-D7EF-46A7-877A-D6EA64E6DB3E@gmail.com> Date: Fri, 26 May 2023 17:14:53 +0200 To: Emacs Bug Report X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Juanma Barranquero , "Mark A. Hershberger" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In `xml-parse-attlist`, we see: ;; Multiple whitespace characters should be replaced with a single = one ;; in the attributes (let ((string (match-string-no-properties 1))) (replace-regexp-in-string "\\s-\\{2,\\}" " " string) ... The call to `replace-regexp-in-string` is of course useless and there is = now a compiler warning telling us, which is how this came to light. However, should we really collapse whitespace here? If I'm reading the = spec correctly, it's not done for CDATA attributes and we have no reason = to believe any other type, do we? I'm no XML expert but it looks like the code is correct and we can just = remove the call to `replace-regexp-in-string` (and the misleading = comment). Or? ------------=_1685461862-9921-1--