From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulf Jasper Newsgroups: gmane.emacs.devel Subject: Re: Drop toplevel XML-comments in libxml-parse-(xml|html)-region? Date: Tue, 11 Nov 2014 20:29:42 +0100 Message-ID: <87d28to7rt.fsf@web.de> References: <8761f4gcdk.fsf@web.de> <87tx25o8pu.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415734221 15220 80.91.229.3 (11 Nov 2014 19:30:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2014 19:30:21 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 11 20:30:15 2014 Return-path: Envelope-to: ged-emacs-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 1XoH8o-0005FF-I6 for ged-emacs-devel@m.gmane.org; Tue, 11 Nov 2014 20:30:14 +0100 Original-Received: from localhost ([::1]:50354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoH8o-0005fv-5F for ged-emacs-devel@m.gmane.org; Tue, 11 Nov 2014 14:30:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoH8S-0005ce-Bw for emacs-devel@gnu.org; Tue, 11 Nov 2014 14:29:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoH8L-0002U4-C0 for emacs-devel@gnu.org; Tue, 11 Nov 2014 14:29:52 -0500 Original-Received: from mout.web.de ([212.227.17.12]:56691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoH8L-0002TZ-2X for emacs-devel@gnu.org; Tue, 11 Nov 2014 14:29:45 -0500 Original-Received: from p55m-ud2 ([217.226.81.169]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0LoYX0-1YTgQn02Ek-00gbie; Tue, 11 Nov 2014 20:29:43 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:ZXhcYCILXOPdTi8n//VqkA8D6EYKYic2SdmZ2DreyaJHBNjgyNa 1OIPn21+N+lfEGNlhwzANPziaPUCYpFgTQxH8VNFJJiBCYkmFYbCzwn+5uMbr+JvhGYLpLa eUyJpw5fH57s1vOo4pq3YLa4kHLZiEOyApXIy1NJNU6IFIXXZcLzJNmGNL/qIKt+Thkc6Y3 OPJ5ZI85fdJJrzA01MCGw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 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:176777 Archived-At: [Hit the wrong key: Reply instead of Follow-up] Lars Magne Ingebrigtsen writes: > I have no opinion in this, but this was added to the libxml code to make > it possible to re-generate XML documents as is, which is not possible > with the way `xml-parse-region' discards top-level comments. > > So I don't know what the right fix here is. On the one hand, it is > (perhaps) surprising that comments are preserved (at all, anywhere) in > the structure returned by the parser. However, stashing data that is to > be further parsed by the HTML engine is a common feature that must be > preserved. > > If we preserve comments further down in the DOM, then not preserving > them at the top level seems inconsistent. > > But perhaps that inconsistency is fine? If comments are to be preserved then they should be preserved everywhere. Agreed. So we leave libxml-parse-(xml|html)-region unchanged. Out of interest: Why preserve xml/html comments at all except for re-generating an XML document?