Option to output the .ods underlying XML files auto formatted?

Hi,

I'm creating a simple API to CRUD simple .ods (calc) files.
I have a copy of the ODF/ODS standard but to be sure I get it right I
often check what LibreOffice
is generating in each case.
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?

By analogy, Qt's QXmlStreamWriter class has special methods for this:
QXmlStreamWriter xml;
...
setAutoFormatting(true);

one can even specify if tabs or spaces are to be used, and how many, like this:
setAutoFormattingIndent(-1); // means use one tab
setAutoFormattingIndent(4); // means use 4 spaces

"Jiergir Ogoerg":

Is there any option in LibreOffice to make it generate _formatted_ underlying XML files?

The XML files by LO are consisting of one long line deliberately to hamper interoperation with a certain well-known competitor products. As a marketing decision, it is unlikely to change.

This has definitely not been a marketing decision. Marketing would have
decided exactly the opposite, i.e. the highest interoperability level
with competition.

Having done my fair share of XML-based development a few years ago,
for another FOSS project, I think I can say, with a fair degree of
authority: That's utter bollocks.

If that *were* true, it wouldn't speak very highly of said
competitor's products' developers, since XML is, by its very
definition, formatted. XML interpreters do not need carriage
returns, line feeds, tabs, spaces and what-have-you. All those
characters do, from a software standpoint, is unnecessarily bulk up a
file.

I had to work with "unformatted" XML. I quickly threw together a
simple bit of code, using existing (also FOSS) XML libraries, to
parse the lines and kick them out in more human-friendly-formatted
output. It was not difficult.

I doubt I bothered to "format" my XML output. I don't recall.

Speaking of formatting, Urmas: Unlike XML parsers, humans *do*
need proper visual formatting to quickly, easily and even
properly interpret text. That being the case: Do you suppose it would
it be possible for you to use an email client that knows how to quote
quoted material in something resembling a traditional manner, or must
we ever *guess* what's yours and what's somebody else's comments?

Regards,
Jim

Italo Vignoli wrote:

The XML files by LO are consisting of one long line deliberately to
hamper interoperation with a certain well-known competitor products. As
a marketing decision, it is unlikely to change.

This has definitely not been a marketing decision. Marketing would have
decided exactly the opposite, i.e. the highest interoperability level
with competition.

It's nonsense anyway. Software is just as capable of reading XML from a single long line or split over multiple lines. Formatting it on multiple lines with indentation just makes it easier for humans to read, but would make files larger and possibly slow down the process of reading and writing the files.

Jim Seymour wrote (18-05-14 14:05)

Having done my fair share of XML-based development a few years ago,
for another FOSS project, I think I can say, with a fair degree of
authority: That's utter bollocks.
[...]
I had to work with "unformatted" XML. I quickly threw together a
simple bit of code, using existing (also FOSS) XML libraries, to
parse the lines and kick them out in more human-friendly-formatted
output. It was not difficult.

There was some option previously, must have been in Load/Save ..
General, to choose between flat and 'formatted' XML.
But indeed for reasons written by Jim (and maybe more), this choice has
been removed.

Cheers,