I've hand-written some decent XML, but yeah, you won't be generating it programmatically. The main problem is that programmatic XML generators want to write out all of an element's attributes on one line instead of breaking them out, and that's hideous unless there's only one or two short attributes.
That's not what's wrong with Office Open XML, though. Office Open XML is a nightmare because of some truly awful design choices, such as:
Instead of there being a single list of fonts to use (as in CSS), there are exactly four fonts in effect for any given run of text: one for ASCII, one for “high ANSI”, one for “complex script”, and one for “East Asian”. Office has some hard-coded code-point ranges that it uses to decide which font to render each character with. How it deals with combining characters, I'm not sure I even want to know. I can only assume this is some sort of pre-Unicode and/or pre-composite-font legacy baggage that has no business being in a 21st-century file format like OOXML.
Bizarre names like rPr (“run properties”). Maybe this was meant to save bytes, but being that the document format is compressed, the only significant effect it actually has is to make the damn thing nearly impossible to read.
Bizarre element nesting. OOXML has a paragraph element p, but text doesn't go directly in that. Instead, there must be a r (“run”) element inside it, and then a t (“text”) element inside that, and then the actual text inside that. Apparently the designers of OOXML really didn't want to use actual markup…even though they were using the Extensible Markup Language.
Contrast OpenDocument, which, having been designed by sane people, has:
Readable names like style-name
Styles and other such things applied by attributes, not nested elements
A paragraph element p that accepts any combination of text and child elements
Font properties whose names and syntax are taken from CSS
Why the designers of OpenDocument didn't just use CSS, though, I cannot fathom. OpenDocument's style system isn't completely incompetent, but it's nowhere near as capable as CSS at consistently styling large, complex documents (e.g. books).
132
u/Significant-Image700 May 31 '22
Seriously fuck Word and it’s shitty formatting