GNOME Bugzilla – Bug 126697
html output generate unexpected new lines
Last modified: 2021-07-05 13:27:21 UTC
Bug with #125093 describe the problem, but only for P tag. Following test case will show that this is general problem. When we have text after/before a tag, after xsl transformation document has new line before/after this tag. Bug is with severity critical, because when we have br tag after/before li tag output is without closing /li tag. When this problem is solved severity can be reduced to enhancement.
Created attachment 21352 [details] test case. more about test case follow:
files: - input.xml : input xml document - used for tests - test.xslt : trivial transformation - cause for problem - xml.xslt : trivial transformation - no problem - test-ok.xslt : extract from my transformations which work arounds for some html tags used in my documents. - tast-all.xslt : extended transformation - might can solve problem at all. make command always will create two files: - wrong.html : result after test.xslt. Take note for missing /li tag - fine.html : result after test-ok.xslt
You use xsl:output indent="yes" support. There can't be *ANY* garantee about the result for formatting blank nodes. If you want control over the blank space do *NOT* use indent="yes" ! Daniel
Which libxml2 version ? Bug does not depend of indent="yes" for 2.4.X. With or without indent="yes" probles exist. For 2.6.x I will check later.
well the stylesheets in the test case had indent="yes" W.r.t. bug fixes, I never backport, so the probability to get 2.4.X fixes are zero (unless you're ready to give a lot of money to Red Hat for custom work !) Daniel
Created attachment 22377 [details] test case without ident="yes"
Transformation without ident="yes" is not solution. Test case with id=22377 show that problem exist on latest stable releases. Output of "test.xslt" is in file "wrong.html". Work around for the problem is transformation in "test-all.xslt" with result in "fine.html", i.e.: - /li tag exist - no unexpected (extra) new lines ========================================================== $ xsltproc --version Using libxml 20603, libxslt 10101 and libexslt 801 xsltproc was compiled against libxml 20603, libxslt 10101 and libexslt 801 libxslt 10101 was compiled against libxml 20603 libexslt 801 was compiled against libxml 20603 ========================================================== About backport :-) ... it is not necessary. I know that problem exist in 2.4.x and I can test immediately. Test for 2.6.x i can perform in different environment. I would like to help with patch :-), not to complain :-(, but I don't have enought time :-(((((((((
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/libxml2/-/issues/ Thank you for your understanding and your help.