Bug 145361 - Cannot convert to XHTML document containing list with line break
Summary: Cannot convert to XHTML document containing list with line break
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-10-28 10:47 UTC by Maxim
Modified: 2021-11-03 10:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example exposing the error (9.29 KB, application/vnd.oasis.opendocument.text)
2021-10-28 10:47 UTC, Maxim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim 2021-10-28 10:47:53 UTC
Created attachment 175972 [details]
Example exposing the error

Debian bullseye with LibreOffice 7.2.2 from backports. Trying to convert a document containing list with line break leads to error

With unoconv:
```
# /usr/bin/python3 /usr/local/bin/unoconv -f  xhtml -o /tmp/test.xhtml list-with-line-break.odt 
XSL Vendor: 'libxslt'
xmlXPathCompOpEval: function replace not found
XPath error : Unregistered function
runtime error: file file:///usr/lib/libreoffice/share/xslt/export/common/body.xsl line 109 element value-of
XPath evaluation returned no result.
unoconv: UnoException during export phase:
Unable to store document to file:///tmp/test.html (Error (com.sun.star.io.IOException){ (com.sun.star.uno.Exception){ Message = (string)"SfxBaseModel::impl_store <file:///tmp/test.html> failed: 0xc10(Error Area:Io Class:Write Code:16) ./sfx2/source/doc/sfxbasemodel.cxx:3180 ./sfx2/source/doc/sfxbasemodel.cxx:1762", Context = (com.sun.star.uno.XInterface)0x0{} } })

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"XHTML Writer File" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x22c6a58{, supportedInterfaces={com.sun.star.io.XOutputStream,com.sun.star.lang.XTypeProvider}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })
```

With LibreOffice directly:
```
# libreoffice --convert-to "html:XHTML Writer File:UTF8" --outdir /tmp/ list-with-line-break.odt 
convert /tmp/list-with-line-break.odt -> /tmp/list-with-line-break.html using filter : XHTML Writer File:UTF8
XSL Vendor: 'libxslt'
xmlXPathCompOpEval: function replace not found
XPath error : Unregistered function
runtime error: file file:///usr/lib/libreoffice/share/xslt/export/common/body.xsl line 109 element value-of
XPath evaluation returned no result.
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///tmp/list-with-line-break.html> failed: 0xc10(Error Area:Io Class:Write Code:16) ./sfx2/source/doc/sfxbasemodel.cxx:3180 ./sfx2/source/doc/sfxbasemodel.cxx:1762)
```

If https://git.libreoffice.org/core/+/3eb870f0843a00042ca7dd89837fbe0cc6f918c2%5E%21/#F0 is reverted, everything is fine:
```
# sed -i "s/replace(\$listIndent, ',', '.')/\$listIndent/" /usr/lib/libreoffice/share/xslt/export/common/body.xsl
# /usr/bin/python3 /usr/local/bin/unoconv -f  xhtml -o /tmp/test.xhtml list-with-line-break.odt 
XSL Vendor: 'libxslt'
# libreoffice --convert-to "html:XHTML Writer File:UTF8" --outdir /tmp/ list-with-line-break.odt 
convert /tmp/list-with-line-break.odt -> /tmp/list-with-line-break.html using filter : XHTML Writer File:UTF8
XSL Vendor: 'libxslt'

```
Comment 1 Michael Warner 2021-10-28 11:34:00 UTC
Also confirmed in a build of master from 27 October:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: ad0b383cbe9ef7d3bc85451c8355d1139942683b
CPU threads: 12; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL

@Noel, any comment on this?
Comment 2 Noel Grandin 2021-10-28 11:47:56 UTC
Does it work if you change the 
   replace
to
   translate
?
Comment 3 Maxim 2021-10-28 12:42:56 UTC
It works but I tested en locale only.
Comment 4 Xisco Faulí 2021-10-28 14:36:40 UTC
Reproduced in

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 97583efeb2e2d21b501b52ba6be2442e955bdec3
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

marking as regression
Comment 5 Commit Notification 2021-10-30 05:46:13 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6c747ccf6cbfe0dc5d591f8ce68a1ca6c63cde53

tdf#145361 fix XSLT for older libxslt

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2021-11-02 17:03:57 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/c10bfb4c582c13a294c1689ed7f9256b24d22075

tdf#145361 fix XSLT for older libxslt

It will be available in 7.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2021-11-03 10:55:37 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7ab9d4caddcf3e2b4e1f5541ebd85f4559bff615

tdf#145361: sw_xhtmlexport: Add unittest

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.