Bug 125228 - meta.xml is not pretty printed when /org.openoffice.Office.Common/Save/Document PrettyPrinting is set to true
Summary: meta.xml is not pretty printed when /org.openoffice.Office.Common/Save/Docume...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.5.2 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2019-05-12 04:12 UTC by Jambunathan K
Modified: 2023-07-20 18:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Custom Properties.odt: Sample ODT file where meta.xml is not pretty printed (8.71 KB, application/vnd.oasis.opendocument.text)
2019-05-12 04:23 UTC, Jambunathan K
Details
screenshot of meta.xml (actual vs expected). Actual one on top window. Expected one (as produced by `xmllint --format` ) is on the bottom (162.85 KB, image/png)
2019-05-12 04:26 UTC, Jambunathan K
Details
meta.xml (as seen in Emacs) is NOT prettified when it should be. (107.32 KB, image/png)
2022-04-21 02:46 UTC, Jambunathan K
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jambunathan K 2019-05-12 04:12:11 UTC
Description:
meta.xml is not pretty printed when /org.openoffice.Office.Common/Save/Document PrettyPrinting is set to true.

Steps to Reproduce:
1. Follow instructions [here](https://help.libreoffice.org/Common/XML_File_Formats) and set Tools – Options – LibreOffice – Advanced – Expert Configuration) by setting the property /org.openoffice.Office.Common/Save/Document PrettyPrinting to true.

2. Open the attached file, make some changes may and save it.

3. Unzip the ODT file and examine the meta.xml

Actual Results:
meta.xml should be pretty printed.  Unfortunately, it is not.



Expected Results:
meta.xml should be pretty printed.


Reproducible: Always


User Profile Reset: No



Additional Info:
As the owner of GNU Emacs' Org-mode to ODT exporter (see https://github.com/kjambunathan/org-mode-ox-odt),  I often examine the XML of all component files: content.xml, styles.xml, manifest.xml, meta.xml etc.  While the XML of all other files are pretty printed, the XML of meta.xml that never gets pretty printed.
Comment 1 Jambunathan K 2019-05-12 04:23:14 UTC
Created attachment 151316 [details]
Custom Properties.odt:  Sample ODT file where meta.xml is not pretty printed
Comment 2 Jambunathan K 2019-05-12 04:26:18 UTC
Created attachment 151317 [details]
screenshot of meta.xml (actual vs expected).  Actual one on top window.  Expected one (as produced by `xmllint --format` ) is on the bottom
Comment 3 Jambunathan K 2019-05-12 04:29:21 UTC
kjambunathan@debian:~$ dpkg -l | grep libreoffice-writer

ii  libreoffice-writer                    1:6.1.5-3                            amd64        office productivity suite -- word processor

kjambunathan@debian:~$ uname -a

Linux debian 4.19.0-5-amd64 #1 SMP Debian 4.19.37-1 (2019-05-05) x86_64 GNU/Linux
Comment 4 Dieter 2019-06-12 08:09:04 UTC
(In reply to Jambunathan K from comment #0)
> Description:
> meta.xml is not pretty printed when
> /org.openoffice.Office.Common/Save/Document PrettyPrinting is set to true.

I'm not an experct in this topic, but th help page only says something about PrettyPrinting and content.xml. But perhaps wiki-page is unclear.

I opened meta.xml from an own file and couldn't see a difference (I used Internet Explorer).
Comment 5 Dieter 2019-12-19 08:04:27 UTC
Jambunathan, a new major release of LibreOffice is available since this bug was reported. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 Jambunathan K 2020-01-23 12:22:59 UTC
(In reply to Dieter Praas from comment #5)
> Jambunathan, a new major release of LibreOffice is available since this bug
> was reported. Could you please try to reproduce it with the latest version
> of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/
> ?I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the latest version.

This issue still exists in

~$ dpkg -l | grep libreoffice-writer
ii  libreoffice-writer                    1:6.3.4-2                            amd64        office productivity suite -- word processor

~$ uname -a
Linux debian 5.4.0-2-amd64 #1 SMP Debian 5.4.8-1 (2020-01-05) x86_64 GNU/Linux


This is how the `meta.xml` looks like

<?xml version="1.0" encoding="UTF-8"?>

<office:document-meta xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" office:version="1.2">
 <office:meta><meta:creation-date>2019-05-12T07:44:34.121843196</meta:creation-date><meta:editing-cycles>3</meta:editing-cycles><meta:editing-duration>PT1H2M30S</meta:editing-duration><dc:date>2019-05-12T09:43:28.907427360</dc:date><meta:generator>LibreOffice/6.3.4.2.0$Linux_X86_64 LibreOffice_project/30$Build-2</meta:generator><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="6" meta:word-count="23" meta:character-count="72" meta:non-whitespace-character-count="55"/><meta:user-defined meta:name="Boolean" meta:value-type="boolean">false</meta:user-defined><meta:user-defined meta:name="Custom Date" meta:value-type="date">2019-05-12</meta:user-defined><meta:user-defined meta:name="Custom Datetime" meta:value-type="date">2019-05-12T00:00:00</meta:user-defined><meta:user-defined meta:name="Custom Duration" meta:value-type="time">P0D</meta:user-defined><meta:user-defined meta:name="Custom Number" meta:value-type="float">10</meta:user-defined><meta:user-defined meta:name="Subtitle" meta:value-type="string">This is a subtitle</meta:user-defined></office:meta>
</office:document-meta>


I expect the `meta.xml` to be pretty printed, but instead I see one long line.
Comment 7 Buovjaga 2020-04-15 16:41:28 UTC
(In reply to Jambunathan K from comment #6)
> I expect the `meta.xml` to be pretty printed, but instead I see one long
> line.

I tested with the steps. I don't see one long line, though, I see 5 lines (just like in your screenshot).

Arch Linux 64-bit
Version: 7.0.0.0.alpha0+
Build ID: b267650fd097f16d1b31c87a11a497294ad4ee42
CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 15 April 2020
Comment 8 QA Administrators 2022-04-16 03:51:35 UTC Comment hidden (obsolete)
Comment 9 Jambunathan K 2022-04-21 02:46:21 UTC
Created attachment 179691 [details]
meta.xml (as seen in Emacs) is NOT prettified when it should be.
Comment 10 Jambunathan K 2022-04-21 02:53:43 UTC
The bug persists in  

$ dpkg -l | grep writer
ii  libreoffice-writer                                 1:7.3.1-1                          amd64    


Version: 7.3.2.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: x11
Locale: en-IN (en_IN); UI: en-US
Debian package version: 1:7.3.1-1
Calc: threaded

Steps  I followed:

1. Make sure that `PrettyPrinting' is ON.
2. Download https://bugs.documentfoundation.org/attachment.cgi?id=151316
3. Add some newlines to the document.  This is so that `meta.xml' gets re-written.
4. Save the file.
5. Unzip the modified file, and open `meta.xml' in a text editor.  Text editor in my case is Emacs.
6. This is what I see https://bugs.documentfoundation.org/attachment.cgi?id=179691.

7. I expect to see `meta.xml' pretty printed 


(Both the reviewers are using Editors that pretty prints the XML even if the raw XML is not pretty printed.  I use Emacs.  It renders the text of the XML as it is in the file.  So, to check my claims please use Emacs or some other editor which doesn't do any "special rendering" of XML.)
Comment 11 Buovjaga 2022-04-21 06:09:11 UTC
Not exclusive to Linux

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ed007423eb4b6d1560d81317b20f291d81bced28
CPU threads: 2; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded Jumbo