Bug 166991 - Do not fail importing (Flat) ODFs with a twice-defined attribute
Summary: Do not fail importing (Flat) ODFs with a twice-defined attribute
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ODF ODF-Flat
  Show dependency treegraph
 
Reported: 2025-06-13 12:08 UTC by Eyal Rozenberg
Modified: 2025-06-13 14:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A sample FODS (1.12 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-06-13 14:16 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2025-06-13 12:08:27 UTC
Sometimes - due to manual editing, mis-copy-pasting, or tool failure - we may encounter an FODT (or ODT) with an XML element that has the same attribute defined twice.

Yes, that is certainly an error; but - it is very easy to recover from, since the syntactic structure of the XML is respected.

LO currently refuses to open such a file, emits an error and gives up.

Instead, we should - either by user authorization or by default - try to recover from this situation and continue opening the file.

The obvious recovery strategy is to let the later re-definition of the attribute override the earlier one. But - it would not be terrible if re-definitions would be ignored.

As I am not much of an FODT smith, I would appreciate a minimal example of this. (Or - I could upload a very-non-minimal example.)
Comment 1 Mike Kaganski 2025-06-13 12:47:21 UTC
If this is to be implemented, then only in recovery mode, where the question will appear, and the document will arrive "recovered".

No idea if it's possible/simple to tweak the XML parser (SAX) that we use, to actually implement that.
Comment 2 Eyal Rozenberg 2025-06-13 12:55:58 UTC
(In reply to Mike Kaganski from comment #1)
> If this is to be implemented, then only in recovery mode, where the question
> will appear, and the document will arrive "recovered".

Sure, that's fair I guess.

> No idea if it's possible/simple to tweak the XML parser (SAX) that we use,
> to actually implement that.

If there's no support for it - we've got a nice idea for a GSoC project or a tender that can get many bidders since it's not LO-specific.
Comment 3 Mike Kaganski 2025-06-13 14:16:14 UTC
Created attachment 201253 [details]
A sample FODS