2014-05-17 23:45 GMT+02:00 Jiergir Ogoerg <f35f22...@gmail.com>:

> Unfortunately all the XML files (which make up the .ods files) aren't
> formatted by LibreOffice so I have to waste
> a lot of time formatting them by hand to be able to analyze the contents.
>
> Is there any option in LibreOffice to make it generate _formatted_
> underlying XML files?
>

​I don't think such an option exist, as it would serve little purpose since:
- Most xml "viewers" are able to format the files on the fly
- There exist tools that can do it, like xmllint. You can easily script the
whole process with the language of your choice.

A dirty example using bash shell scripting, that would extract the ods
content and clean the xml in-place:

#!/bin/bash
> ODSFILE="$1"
> TMPFILE=$(mktemp
> ​)​
>

unzip "$ODSFILE"
> for i in $(find -name '*.xml')
> do
>     mv "$i" "$TMPFILE"
>     xmllint --pretty 1 "$TMPFILE"
> ​> ​
> "$i"
> done


that should be way easier than to add an option to pretty-print internals
in LibreOffice...

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to