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: Wed, 12 Nov 2014 21:24:27 +0100 Message-ID: <87r3x86ubo.fsf@web.de> References: <8761f4gcdk.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1415823913 25888 80.91.229.3 (12 Nov 2014 20:25:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Nov 2014 20:25:13 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 12 21:25:06 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 1XoeTS-0000bU-0i for ged-emacs-devel@m.gmane.org; Wed, 12 Nov 2014 21:25:06 +0100 Original-Received: from localhost ([::1]:56601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeTR-0006O7-Gy for ged-emacs-devel@m.gmane.org; Wed, 12 Nov 2014 15:25:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeT6-0006Nq-Ev for emacs-devel@gnu.org; Wed, 12 Nov 2014 15:24:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoeSy-0000WO-0t for emacs-devel@gnu.org; Wed, 12 Nov 2014 15:24:44 -0500 Original-Received: from mout.web.de ([212.227.15.3]:50491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeSx-0000Vk-Ma for emacs-devel@gnu.org; Wed, 12 Nov 2014 15:24:35 -0500 Original-Received: from p55m-ud2 ([217.226.79.183]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LdmgV-1YE7e31bCl-00j4sO; Wed, 12 Nov 2014 21:24:28 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:hXcd2Es+ZpSyVcQe0MuBxxbx4uosTcpzWIU8Xsc5r6lYq1WGSVh UWekcdmbI5M5zIWp/Z4sp4MnDCgBvcjq0miC78uAIZabnDqneij/yINlEUetTfetej94AUR YwF28ire09QsdRMUCaRNnWqKZ9J4/vJmWuYYtWe5bVWYpZpbUnC6T78DNKFrUxRxLGdzDsx xOgc70QZy3R2q5JJOY1cw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.3 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:176840 Archived-At: --=-=-= Content-Type: text/plain Lars Magne Ingebrigtsen writes: > Lars Magne Ingebrigtsen writes: > >> But the only problematic comment is the top-level one, because that >> makes the structure different than if the comment wasn't there. Perhaps >> we could just cheat and push any top-level comments one step down in the >> DOM? I mean, it's gross, but I don't think anybody would actually >> notice in real life. > > It would mean that > > > bar > > > would turn into > > > bar > > > where indentation represents where in the DOM the element appears. Sort > of. In that case we would get (foo nil (comment nil "level 0") (comment nil "level 1") (bar nil (comment nil "level 2")))) instead of (top nil (comment nil "level 0") (foo nil (comment nil "level 1") (bar nil (comment nil "level 2")))) for this xml --=-=-= Content-Type: text/xml Content-Disposition: inline --=-=-= Content-Type: text/plain That would work but seems a bit strange. I think I would vote for Stefan's idea to introduce an optional parameter which controls removal of all comments. That would result in (foo nil (bar nil)) which does not look so bad. --=-=-=--