Bug 37390 - LibreOffice writes invalid ODF (please don't re-open, file new bugs instead)
Summary: LibreOffice writes invalid ODF (please don't re-open, file new bugs instead)
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.0 RC1
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: odf odf_validation
Keywords:
Depends on: 44073 44082
Blocks: mab3.4
  Show dependency treegraph
 
Reported: 2011-05-19 18:51 UTC by Olav Dahlum
Modified: 2012-02-24 04:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document that passes the tests. (45.94 KB, application/vnd.oasis.opendocument.text)
2011-05-19 18:51 UTC, Olav Dahlum
Details
Document used for testing. (8.82 KB, application/vnd.oasis.opendocument.text)
2011-09-09 12:10 UTC, NoOp
Details
ODF1.2_LO343.odt (ODF1.2(strict) (8.44 KB, application/vnd.oasis.opendocument.text)
2011-09-12 09:59 UTC, NoOp
Details
/NameSpaceResilience-02-DefaultNS_Extended_343.odt (11.62 KB, application/vnd.oasis.opendocument.text)
2011-10-03 18:15 UTC, NoOp
Details
NameSpaceResilience-02-DefaultNS_NonExtended_343.odt (11.61 KB, application/vnd.oasis.opendocument.text)
2011-10-03 18:16 UTC, NoOp
Details
NameSpaceResilience-02-DefaultNS_Extended_334.odt (11.77 KB, application/vnd.oasis.opendocument.text)
2011-10-03 18:16 UTC, NoOp
Details
NameSpaceResilience-02-DefaultNS_NonExtended_334.odt (11.75 KB, application/vnd.oasis.opendocument.text)
2011-10-03 18:17 UTC, NoOp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olav Dahlum 2011-05-19 18:51:26 UTC
Created attachment 46924 [details]
Document that passes the tests.

I won't go further into details as several people have pointed them out already, but this is a real problem and I did do some checks to confirm this.

http://comments.gmane.org/gmane.comp.documentfoundation.libreoffice.user/4599
Comment 1 Olav Dahlum 2011-05-19 18:54:26 UTC
Comment on attachment 46924 [details]
Document that passes the tests.

Old file…
Comment 2 Petr Mladek 2011-05-20 07:54:10 UTC
Cedric, could you please have a look?

I lower the severity a bit because it is an older bug and can't break 3.4.0 release. On the other hand, it important, so I add it to most annoying bugs. We will do our best to fix it for LO-3.4.1 and LO-3.3.3.
Comment 3 Cédric Bosdonnat 2011-06-08 02:45:26 UTC
Fixed in master and 3.4 branches:

http://cgit.freedesktop.org/libreoffice/libs-core/commit/?h=libreoffice-3-4&id=97c995a22c1602679a3e386f994a20b23d07f429

The manifest:version bug was fixed much earlier than this bug report (couldn't get a hand on the commit number again)
Comment 4 NoOp 2011-09-09 12:09:11 UTC
LO 3.4.3 (linux): created a document with a single line of text (attached) with ODF 1.2 extended set (Tools|Options|Load/Save|General|ODF format version: 1.2 Extended (recommended) and then ran it through the same validator: 
http://tools.odftoolkit.org/odfvalidator/

Results are:
ODF Validator Result Page
Result for ODF1.2extended_LO343_result.odt

This file is NOT valid

Result details:

upload:///ODF1.2extended_LO343_result.odt:Info:ODF Version: 1.2
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-manifest-schema.rng:Info:parsed.
upload:///ODF1.2extended_LO343_result.odt/META-INF/manifest.xml:Info:no errors, no warnings
upload:///ODF1.2extended_LO343_result.odt/mimetype:Info:no errors, no warnings
upload:///ODF1.2extended_LO343_result.odt:Info:Media Type: application/vnd.oasis.opendocument.text
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-schema.rng:Info:parsed.
upload:///ODF1.2extended_LO343_result.odt/meta.xml:Info:Generator: LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-302
upload:///ODF1.2extended_LO343_result.odt/meta.xml:Info:no errors, no warnings
upload:///ODF1.2extended_LO343_result.odt/settings.xml:Info:no errors, no warnings
upload:///ODF1.2extended_LO343_result.odt/styles.xml[2,12915]:Error:unexpected attribute "style:layout-grid-snap-to-characters"
upload:///ODF1.2extended_LO343_result.odt/styles.xml:Info:1 errors, no warnings
upload:///ODF1.2extended_LO343_result.odt/content.xml:Info:no errors, no warnings
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-dsig-schema.rng:Info:parsed.
upload:///ODF1.2extended_LO343_result.odt:Info:1 errors, no warnings

I do not know if the validator is 'valid', but given that this bug report used that as the basis for testing originally, then the result is that the document still doesn't meet ODF standards. Please review. Thanks.
Comment 5 NoOp 2011-09-09 12:10:17 UTC
Created attachment 51016 [details]
Document used for testing.
Comment 6 Julien Nabet 2011-09-11 04:59:42 UTC
Hello,

I'm on a LO master repo, updated today.
I created a one line file too :
- once in ODF 1.2 extended
- once in ODF 1.2

I test ODF validation with the same url, it works perfectly.

I opened the file of Noop and resaved it in 2 ways again :
- once in ODF 1.2 extended
- once in ODF 1.2
the same bug in his file is still there but perhaps it's normal.

(I'm on Debian x86 testing updated)

Julien.
Comment 7 NoOp 2011-09-11 16:58:25 UTC
@Julien: I'm confused. What specifically do you mean 'LO master repo'?

It will be helpful if: 1) you can tell us the meaning of 'LO master repo', and 2) specifically which version ($ cat <pathtoLO>//program/versionrc) you tested with.

The version that I tested with is:
$ cat /opt/libreoffice3.4/program/versionrc
[Version]
AllLanguages=en-US
BuildVersion=
buildid=340m1(Build:302)
ExtensionUpdateURL=http://updateexte.libreoffice.org/ExtensionUpdateService/check.Update
OOOBaseVersion=3.4
ProductBuildid=302
ProductMajor=340
ProductMinor=1
ProductSource=OOO340
UpdateID=LibreOffice_3_en-US
UpdateURL=
UpdateUserAgent=<PRODUCT> (${buildid}; ${_OS}; ${_ARCH}; BundledLanguages=${AllLanguages})
Vendor=The Document Foundation
Comment 8 Cédric Bosdonnat 2011-09-12 00:25:55 UTC
(In reply to comment #4)
> LO 3.4.3 (linux): created a document with a single line of text (attached) with
> ODF 1.2 extended set (Tools|Options|Load/Save|General|ODF format version: 1.2
> Extended (recommended) and then ran it through the same validator: 
> http://tools.odftoolkit.org/odfvalidator/

The problem is all said here: you're trying to validate something that has more features than ODF 1.2. If you want to test ODF files, please generate ODF 1.2 strict files. ODF 1.2 extended that is not validating is not a bug... it simply allows us to go a bit further/quicker than ODF.

> I do not know if the validator is 'valid', but given that this bug report used
> that as the basis for testing originally, then the result is that the document
> still doesn't meet ODF standards. Please review. Thanks.

In order for it to be a real bug, you need to validate ODF 1.2 strict files... not extended ones.
Comment 9 NoOp 2011-09-12 09:58:38 UTC
@Cédric: ODF1.2 Extended is the recommended setting. Changing to 1.2 (strict) warns about data loss. In any event, here you go using 1.2 (strict):

ODF Validator Result Page
Result for ODF1.2_LO343.odt

This file is NOT valid

Result details:

upload:///ODF1.2_LO343.odt:Info:ODF Version: 1.2
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-manifest-schema.rng:Info:parsed.
upload:///ODF1.2_LO343.odt/META-INF/manifest.xml:Info:no errors, no warnings
upload:///ODF1.2_LO343.odt/mimetype:Info:no errors, no warnings
upload:///ODF1.2_LO343.odt:Info:Media Type: application/vnd.oasis.opendocument.text
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-schema.rng:Info:parsed.
upload:///ODF1.2_LO343.odt/meta.xml:Info:Generator: LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-302
upload:///ODF1.2_LO343.odt/meta.xml:Info:no errors, no warnings
upload:///ODF1.2_LO343.odt/settings.xml:Info:no errors, no warnings
upload:///ODF1.2_LO343.odt/styles.xml[2,10798]:Error:unexpected attribute "style:layout-grid-snap-to-characters"
upload:///ODF1.2_LO343.odt/styles.xml:Info:1 errors, no warnings
upload:///ODF1.2_LO343.odt/content.xml:Info:no errors, no warnings
internal:schema/odf12/OpenDocument-v1.2-cd05-rev02-dsig-schema.rng:Info:parsed.
upload:///ODF1.2_LO343.odt:Info:1 errors, no warnings

The errors are:
upload:///ODF1.2_LO343.odt/styles.xml[2,10798]:Error:unexpected attribute "style:layout-grid-snap-to-characters"
upload:///ODF1.2_LO343.odt:Info:Generator: LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-302
Comment 10 NoOp 2011-09-12 09:59:27 UTC
Created attachment 51081 [details]
ODF1.2_LO343.odt (ODF1.2(strict)
Comment 11 Julien Nabet 2011-09-12 13:12:59 UTC
(In reply to comment #7)
> @Julien: I'm confused. What specifically do you mean 'LO master repo'?
> 
"LO" = Libreoffice, "repo" = repository.
So I don't use a specific version but the last sources of Libreoffice in the main branch call "Master".

> It will be helpful if: 1) you can tell us the meaning of 'LO master repo'
Done now

> 2) specifically which version ($ cat <pathtoLO>//program/versionrc) you tested
> with.
> 
No specific version as explained just before.

Julien.
Comment 12 NoOp 2011-10-03 18:14:17 UTC
I ran the file:
NameSpaceResilience-02-DefaultNS.odt
from
<http://tools.oasis-open.org/version-control/svn/oic/TestSuite/trunk/odf12/NameSpaceResilience/>
through:
http://tools.odftoolkit.org/odfvalidator/
and it passes.

I then opened the file in LO 3.4.3 (linux) using the default 1.2
(extended) and saved it as:
NameSpaceResilience-02-DefaultNS_Extended_343.odt
and ran it through the same tool. Result is:

This file is NOT valid

Result details:

> > This file is NOT valid
> > 
> > Result details:
> > 
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_343.odt/styles.xml[2,5299]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_343.odt/styles.xml[2,5886]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_343.odt:Info:Generator: LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-302
> > 
> > 
Turned off 'extended' and used only 1.2 and resaved as:
NameSpaceResilience-02-DefaultNS_NonExtended_343.odt
Reran the test:

> > This file is NOT valid
> > 
> > Result details:
> > 
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_343.odt/styles.xml[2,5249]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_343.odt/styles.xml[2,5836]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_343.odt:Info:Generator: LibreOffice/3.4$Linux LibreOffice_project/340m1$Build-302
Did the same with LO 3.3.4:

3.3.4 1.2 Extended:

> > Result for NameSpaceResilience-02-DefaultNS_Extended_334.odt
> > 
> > This file is NOT valid
> > 
> > Result details:
> > 
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_334.odt/META-INF/manifest.xml[2,88]:Error:element "manifest:manifest" is missing "version" attribute
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_334.odt/styles.xml[2,5441]:Error:attribute "style:text-combine-start-char" has a bad value: the length of the value is 0, but the required length is 1.
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_334.odt/styles.xml[2,6028]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_Extended_334.odt:Info:Generator: LibreOffice/3.3$Linux LibreOffice_project/330m19$Build-401
3.3.4 1.2 Non-extended:

> > Result for NameSpaceResilience-02-DefaultNS_NonExtended_334.odt
> > 
> > This file is NOT valid
> > 
> > Result details:
> > 
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_334.odt/META-INF/manifest.xml[2,88]:Error:element "manifest:manifest" is missing "version" attribute
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_334.odt/styles.xml[2,5391]:Error:attribute "style:text-combine-start-char" has a bad value: the length of the value is 0, but the required length is 1.
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_334.odt/styles.xml[2,5978]:Error:attribute "fo:hyphenation-remain-char-count" has a bad value: "0" does not satisfy the "positiveInteger" type
> > upload:///NameSpaceResilience-02-DefaultNS_NonExtended_334.odt:Info:Generator: LibreOffice/3.3$Linux LibreOffice_project/330m19$Build-401
Comment 13 NoOp 2011-10-03 18:15:29 UTC
Created attachment 51909 [details]
/NameSpaceResilience-02-DefaultNS_Extended_343.odt
Comment 14 NoOp 2011-10-03 18:16:10 UTC
Created attachment 51910 [details]
NameSpaceResilience-02-DefaultNS_NonExtended_343.odt
Comment 15 NoOp 2011-10-03 18:16:52 UTC
Created attachment 51911 [details]
NameSpaceResilience-02-DefaultNS_Extended_334.odt
Comment 16 NoOp 2011-10-03 18:17:29 UTC
Created attachment 51912 [details]
NameSpaceResilience-02-DefaultNS_NonExtended_334.odt
Comment 17 Michael Stahl (allotropia) 2011-12-22 12:56:15 UTC
grmbl...
this bug is a complete mess.
please file one bug per invalid XML element!
(you wouldn't file a bug "LO crashes" and then describe 3 completely different crashes in there, would you?)
Comment 18 NoOp 2011-12-22 15:13:31 UTC
Like this one?
<https://bugs.freedesktop.org/show_bug.cgi?id=44082>
[ODF: invalid hyphenation attributes written]

The title of this bug is "LibreOffice does not create valid ODF." I simply
added the information from the tests that I performed.
Comment 19 Michael Stahl (allotropia) 2012-01-03 04:05:46 UTC
NoOp: my point is that it doesn't make sense to have a bug with such a title,
except perhaps as a tracking bug.

okay, now what about all those problems:

- the manifest problem is OOo issue 115789, fixed for OOo 3.4
- the layout-grid-snap-to attribute problem is bug 44073,
  fixed on master, 3.5, 3.4.5
- the style:text-combine-start-char problem is OOo issue 114107,
  fixed for OOo 3.4
- the hyphenation attribute problem is bug 44082,
  fixed on master, 3.5, 3.4.5

so everything should be fixed now.