So I have this legacy proprietory database that can spew some well-formed XML.
I'd like to XSLT the shit out of some records to obtain OpenOffice documents nice enough to please a secretary, be signed by the big boss and sent out as official corporate snail mail. Legally binding so better be exact. The resulting document is pretty simple, your average business letter with maybe a table or two, two pages at the very most. Don't ask me why they still use snail mail.
I see that OpenOffice documents are, of course, XML too. (MS Office too maybe, that's an option, but I'll stick to OO for now).
My experience with XSLT does'nt go much farther than basic tutorials, some years back.
I've quicky scouted the web in search of the OOo DTD, and it's more elusive than I thought.
I'd appreciate some pointers to get me started.
1/ Where are those damned OpenOffice DTDs ?
2/ There must be out there some example of XSLT to OOo. Know any ?
3/ What would be the correct though process ? Of course, I could parse the original XML and generate the output on the fly, element by element, but that would be tedious and I'd rather not go that way. My concern here is to find a way to write the adequate XSLT stylesheet. Where should I start ?
To give it all a little substance, please find enclosed a simplified mockup of the original XML.
<document>
<metadata>Don't care</metadata>
<body>
<sendto>
<person>Mrs Jane Doe</person>
<street>Pensylvania Av.</street>
<number>1234</number>
<zip>QLD-56789</zip>
<city>Brisbane</city>
</sendto>
<placedate>Bumfuck, AZ, march 29th 2017</placedate>
<subject>
Our order #
<ordernumber>G-27b/6</ordernumber>
</subject>
<phrases>
<phrase>blah</phrase>
<phrase>bleh</phrase>
</phrases>
<order>
<item>
<reference>42</reference>
<name>Bath towel</name>
<unitprice>4.2</unitprice>
<quantity>20.0</quantity>
<totalprice>84.0</totalprice>
</item>
<item>...</item>
...
<item>...</item>
<totalprice>1024.0</totalprice>
</order>
<deliverto>
<person>...</person>
<street etc.></street>
</deliverto>
<phrases>
<phrase>...</phrase>
<phrase>Thx, ciao</phrase>
</phrases>
<signature>
<person>Zap Branigan</person>
<title>Director of corporate stuffs</title>
</signature>
</body>
</document>