Hi monks,
I'm stuck on a problem that I know how to solve but I'm sure that it can be done much better.
The task: use OpenOffice to generate a doc that can be used as a template for generating other docs, using perl. Think of it as a fill-in form, but with parts of it that can be removed (conditional) or repeated (iterating on an array/hash) or both. I don't need to programmatically edit the style of the doc, only the text.
The problem is that I want the template editable with OO, so its contents has to be a well-formed XML file and every metadata or command has to be in the text part. So, if I want a line in a table - say the header - removed, I need to specify the conditional command in the text, but the template processor has to remove the entire <table-row> tag from the XML stream.
I *could* do it in perl, opening the zipped doc, extracting and parsing the XML content, and proceesing it with XML::Twig. I don't want to reinvent the wheel, but I don't see how this can be done using TT or other template processor I heard of.
Any idea?
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
In reply to OpenOffice, XML and templates by psini
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |