After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 495668 - xsltSaveResultTo appends a linefeed to XML and HTML output
xsltSaveResultTo appends a linefeed to XML and HTML output
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.22
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-11-10 18:27 UTC by Alexey Proskuryakov
Modified: 2021-07-05 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexey Proskuryakov 2007-11-10 18:27:27 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?
Comment 1 GNOME Infrastructure Team 2021-07-05 11:00:08 UTC
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.