[Libreoffice] XML pretty printer (was: Where did Setup.xcu go?)

Stephan Bergmann stephan.bergmann.secondary at googlemail.com
Thu Aug 11 02:10:59 PDT 2011


On Aug 10, 2011, at 11:28 PM, Eike Rathke wrote:
> On Wednesday, 2011-08-10 17:48:14 +0200, Stephan Bergmann wrote:
>> For performance reasons, it (like all the other xcu files, too) got
>> folded into a single large main.xcd.  (Beware, very long lines.  You
>> may want to pipe it through an XML pretty printer if you want to edit
>> it manually.)
> 
> For which I always recommend xmlpp,
> http://software.decisionsoft.com/tools.html

Beware, that page states that xmlpp is "[a]n XML pretty printer created to format XML that doesn't make use of mixed content."  But the schema for xcs/xcu/xcd files does make use of mixed content, namely with the <unicode> element nested in <value> and <it> elements (see <http://cgit.freedesktop.org/libreoffice/core/tree/officecfg/registry/component-update.dtd?id=c2a634416ba8f385c25c16cc52aeae6f68cab9db>).  And xmlpp would indeed corrupt such content:

> $ printf '%s' '<value>foo<unicode oor:scalar="0"/>bar</value>' | ./xmlpp.pl
> <value>foo
>   <unicode oor:scalar='0' />bar
> </value>

You would need an XML pretty printer that you feed an XML document plus its DTD, but I have no idea whether such a thing exists. -- Then again, I'm not aware that there is any use of the <unicode> element within the current officecfg/registry corpus...

-Stephan


More information about the LibreOffice mailing list