GNOME Bugzilla – Bug 495668
xsltSaveResultTo appends a linefeed to XML and HTML output
Last modified: 2021-07-05 11:00:08 UTC
From <http://bugs.webkit.org/show_bug.cgi?id=15919>. xsltSaveResultTo() always appends "\n" at the end if the output is XML or HTML. I couldn't find any reason why this is necessary, and this causes compatibility problems for WebKit. The following paragraph from <http://www.w3.org/TR/xml-c14n> might or might not be related to this issue: ------------------------------------------- The C14N-20000119 Canonical XML draft placed a #xA after each PI outside of the document element as well as a #xA after the end tag of the document element. The method in this specification performs the same function except for omitting the final #xA after the last PI (or comment or end tag of the document element). This technique ensures that PI (and comment) children of the root are separated from markup by a line feed even if root node or the document element are omitted from the output node-set. ------------------------------------------- It seems that code for XML is in xsltutils.c, but code for HTML is actually in libxml2. Would unconditionally stripping trailing "\n" form the result be a correct workaround?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxslt/-/issues/ Thank you for your understanding and your help.