GNU bug report logs - #41094
28.0.50; `xml-print' produces invalid XML

Previous Next

Package: emacs;

Reported by: Philipp <p.stephani2 <at> gmail.com>

Date: Tue, 5 May 2020 12:32:01 UTC

Severity: minor

Found in version 28.0.50

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 41094-done <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: 41094-done <at> debbugs.gnu.org
Subject: Re: bug#41094: 28.0.50; `xml-print' produces invalid XML
Date: Sat, 23 May 2020 14:03:39 +0200
Am Di., 5. Mai 2020 um 14:32 Uhr schrieb Philipp <p.stephani2 <at> gmail.com>:
>
>
> For example:
>
> emacs -Q -batch -l xml -eval '(with-temp-buffer (xml-print (quote ((foo nil "\0")))) (write-region nil nil "/tmp/test.xml"))' && xmllint /tmp/test.xml
> /tmp/test.xml:1: parser error : Premature end of data in tag foo line 1
> <foo>
>      ^
>
> `xml-print' here generates a NUL character, which is invalid in XML
> (cf. https://www.w3.org/TR/xml/#charsets).  Probably `xml-escape-string'
> should error out when encountering any invalid character (including
> non-Unicode characters).

Fixed with commit f8581bcf6a.




This bug report was last modified 5 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.