Created attachment 78726 [details] ZIP file containing a sample ODS document and the corresponding XHTML export. When exporting an ODS document as XHTML, the CSS stylesheet contained in the <style> element is buggy in several respects: 1. The border-width attribute is exported has a comma instead of a point as decimal separator, e.g. border-width:0,021cm instead of border-width:0.021cm. Other width attributes seem to be okay. 2. The stylesheet contains XML-like comments, e.g. <!-- ODF styles with no properties representable as CSS -->. However, CSS comments must be Java style, e.g. /* ODF styles with no properties representable as CSS */ 3. The stylesheet contains empty blocks, e.g. { }. This is invalid. Operating System: Linux (Other) Version: 4.0.2.1 rc
Well, these are three different bugs, so there should be three reports. But let's ignore the technicalities... IMHO at least the first two bugs should be very easily fixable by anyone who knows XSLT, so I am marking this as EasyHack. The code in question is filter/source/xslt/odf2xhtml with some parts in filter/source/xslt/common . Some pointers to the individual problems: 1. I would start looking at template round-up-border-width in filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl . 2. This is because of the use of xsl:comment in the CSS export code, e.g., template create-page-layout in filter/source/xslt/odf2xhtml/export/xhtml/header.xsl . Obviously these must be changed to plain /* */. 3. I have not been able to spot a likely problematic place in a quick look, so I leave this as excercise to the reader :-)
#2 and #3 fixed in https://gerrit.libreoffice.org/#/c/3851 But #1 is a locale problem. In locales where the decimal separator is a comma (like de_DE or pt_BR), the output CSS is wrong. What should be done in this case?
CSS output should never be localized, but the decimal point must always be a dot ('.'). See the specification here: <http://www.w3.org/TR/CSS2/syndata.html#numbers>.
Yes, I know the decimal separator cannot be localized in CSS. What I meant is how can we prevent it to be localized (since it does the localization automatically when doing any calculation)?
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.