Re: manually changing content.xml > invalid xml.. but why

2019-09-04 Thread Cor Nouws
Hi Eike, Regina,

Thanks for the answers.. Solved.

Eike Rathke wrote on 9/4/19 8:26 PM:

> How do you re-zip the file?

Let me elaborate. It is far from the first time that I unzip an odf
fully, change something, and then rezip.
Never had any problem. Might just have been lucky :)

> Best is to freshen the zip with just the
> content.xml to keep the original file order and compression, i.e. the
> 'mimetype' file MUST be the first entry in the zip archive and MUST NOT
> be compressed. So,
> 
>   zip -f filename.ods content.xml
> 
> should do.

Indeed, that helps. (Notably the Gnome archive manager allows to open
one file to edit and have it refreshed after closing the editor - this
is similar to what Regina writes).

> If that doesn't help then it's something different ("invalid
> xml" is a vague description).

"The file XXX is corrupt and therefore cannot be opened. ..."
The invalid xml notice is something that is shown in the emacs status.
But appears to be a red herring to me now. Especially since that notice
appears without doing anything in the file. Prolly checked against
another xml schema.

Cor

-- 
Cor Nouws
GPD key ID: 0xB13480A6 - 591A 30A7 36A0 CE3C 3D28  A038 E49D 7365 B134 80A6
- vrijwilliger https://nl.libreoffice.org
- volunteer https://www.libreoffice.org
- Member Board The Document Foundation
- http://www.nouenoff.nl / https://www.mijncloudoffice.nl
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: manually changing content.xml > invalid xml.. but why

2019-09-04 Thread Regina Henschel

Hi,

I do not unzip to a folder. But I use "Open Archive" from 7-Zip. The 
context menu of content.xml then has "View" and "Edit". I have setup 
7-Zip to use "XML Notepad" with "Edit" and Notepad++ with "View". Then I 
use either of them to change the content of content.xml and use "Save" 
in those applications. Then close them. Now 7-Zip ask whether I want to 
update the file. Say "yes" and close 7-Zip. It has always worked. You 
might notice, that I'm working on Windows 10.


From my experience with unzipping to folder, a very common error is, 
that people do not zip the content of the folder, but the entire folder.


Kind regards
Regina

Eike Rathke schrieb am 04-Sep-19 um 20:26:

Hi Cor,

On Wednesday, 2019-09-04 19:45:33 +0200, Cor Nouws wrote:


So I try to remove from the content.xml.
This results in invalid xml file.. that LO needs to repair on opening.
Already the slightest change in the xml file (adding a space in string
"foo") makes the file invalid.


How do you re-zip the file? Best is to freshen the zip with just the
content.xml to keep the original file order and compression, i.e. the
'mimetype' file MUST be the first entry in the zip archive and MUST NOT
be compressed. So,

   zip -f filename.ods content.xml

should do. If that doesn't help then it's something different ("invalid
xml" is a vague description).

   Eike



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: manually changing content.xml > invalid xml.. but why

2019-09-04 Thread Eike Rathke
Hi Cor,

On Wednesday, 2019-09-04 19:45:33 +0200, Cor Nouws wrote:

> So I try to remove from the content.xml.
> This results in invalid xml file.. that LO needs to repair on opening.
> Already the slightest change in the xml file (adding a space in string
> "foo") makes the file invalid.

How do you re-zip the file? Best is to freshen the zip with just the
content.xml to keep the original file order and compression, i.e. the
'mimetype' file MUST be the first entry in the zip archive and MUST NOT
be compressed. So,

  zip -f filename.ods content.xml

should do. If that doesn't help then it's something different ("invalid
xml" is a vague description).

  Eike

-- 
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A


signature.asc
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice