Bug 137764 - New Writer formula functions should use dedicated namespace in ODF
Summary: New Writer formula functions should use dedicated namespace in ODF
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: odf
Keywords:
Depends on:
Blocks: Writer-Tables-Formulas
  Show dependency treegraph
 
Reported: 2020-10-26 09:57 UTC by Mike Kaganski
Modified: 2023-08-18 11:02 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2020-10-26 09:57:15 UTC
In  tdf#123388, tdf#123354, tdf#123390, tdf#123356, new functions were added to formulas in Writer: PRODUCT, ABS, SIGN, COUNT.

They all are written into ODF using usual syntax, e.g. in text:formula attribute of text:expression element, or in table:formula attribute of table:table-cell element.

These attributes are defined as "The attribute value should begin with a namespace prefix followed by ":" (U+003A, COLON), followed by the text of the formula. The namespace bound to the prefix determines the syntax and semantics of the formula".

The namespace used in current master for these formulas is xmlns:ooow="http://openoffice.org/2004/writer". It looks like we expect any application that supports the old OpenOffice formulas to support these new added functions.

Should we introduce a special namespace for the formulas with new functions? Maybe have the functions standardized in a next version of ODF standard (as a common standardized set of functions and formula syntax)? Otherwise, we risk having multiple incompatible extensions/implementations of the formulas for Writer.
Comment 1 Michael Stahl (allotropia) 2020-10-26 10:16:43 UTC
ideally all the formulas in Writer should conform to the OpenFormula part:

https://oasis-tcs.github.io/odf-tc/odf1.3/content.odf13-formula.html

... but whether the current implementation does that is anybody's guess ...

if we could be confident that the implementation matches the specification, we should use the corresponding namespace from the specification.
Comment 2 László Németh 2020-10-26 10:17:58 UTC
@Mike: You are right, the extra functions mean potential back compatibility problem in this form. It seems for me, both Writer and Word use obsolete formula syntax, and the future solution (in the case of Writer and the ODF standard) would be to replace the recent formula engine, adding a formula conversion for old files. But I don't know, whether it's possible to record my interoperability extension with a relatively simple namespace change.
But most of the extra functions have a full-compatible preliminary version in the git, so maybe it's possible to re-use those for the ODF export to avoid back-compatibility problems. Thanks for the report.
Comment 3 László Németh 2020-10-26 10:25:38 UTC
(In reply to Michael Stahl (CIB) from comment #1)
> ideally all the formulas in Writer should conform to the OpenFormula part:
> 
> https://oasis-tcs.github.io/odf-tc/odf1.3/content.odf13-formula.html
> 
> ... but whether the current implementation does that is anybody's guess ...
> 
> if we could be confident that the implementation matches the specification,
> we should use the corresponding namespace from the specification.

Unfortunately, the new conformant functions (for example, AVERAGE instead of Writer's MEAN) can be combined with the old non-conformant functions.
Comment 4 QA Administrators 2022-11-11 03:56:37 UTC Comment hidden (obsolete)
Comment 5 Michael Stahl (allotropia) 2023-08-18 11:02:25 UTC
fwiw i looked into this a year ago with some help from Eike and filed
 https://issues.oasis-open.org/browse/OFFICE-4135
"investigation of suitability of OpenFormula for word processors"