emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drop toplevel XML-comments in libxml-parse-(xml|html)-region?


From: Ulf Jasper
Subject: Re: Drop toplevel XML-comments in libxml-parse-(xml|html)-region?
Date: Tue, 11 Nov 2014 20:29:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

[Hit the wrong key: Reply instead of Follow-up]

Lars Magne Ingebrigtsen <address@hidden> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]