[Sussex] Manipulating ODT files

Brendan Whelan b_whelan at mistral.co.uk
Mon Jul 23 14:17:51 UTC 2007


Thanks Nic,

Your information gave me the clues I needed so having proved the concept of
how to manipulate file content, I am now building the software
infrastructure needed for our specific requirement.

Brendan
----- Original Message -----
From: "Nic James Ferrier" <nferrier at tapsellferrier.co.uk>
To: "LUG email list for the Sussex Counties" <sussex at mailman.lug.org.uk>
Sent: Monday, July 23, 2007 12:56 PM
Subject: Re: [Sussex] Manipulating ODT files


> "Brendan Whelan" <b_whelan at mistral.co.uk> writes:
>
> > I am trying to change the content of OpenOffice ODT files using PHP
programs.
> > gunzip my_file.odt   gives a directory name my_files.odt_FILES
containing various directories and files, including content.xml.
> > I can change items within content.xml.
> > My attempts at rezipping the files back to an odt don't give the correct
structure.
> > How do I rezip the directories and files to give a valid odt file?
>
> As far as I know you just rezip it.
>
> Here's a fragment of a Makefile that I use that creates my CV from a
> very elabourate set of steps:
>
>
>   cv.odt: cv/content.xml
>           bash -c 'cd cv ; zip -r ../cv.odt *'
>
>
>   cv/content.xml: html2oo.xslt cv.html cv
>           xsltproc --html html2oo.xslt cv.html > cv/content.xml
>
>   cv:
>           [ -d cv ] || ( mkdir cv ; unzip -d cv cv.odt )
>
>   cv.html: cv.xoxo cv-html.xslt
>           xsltproc cv-html.xslt cv.xoxo > cv.html
>
> So if I go:
>
>    make cv.odt
>
> it does,
>
> Hope that helps!
>
> --
> Nic Ferrier
> http://www.tapsellferrier.co.uk
>
> __
> Sussex mailing list
> Sussex at mailman.lug.org.uk
> E-mail Address: sussex at mailman.lug.org.uk
> Sussex LUG Website: http://www.sussex.lug.org.uk/
> https://mailman.lug.org.uk/mailman/listinfo/sussex
>






More information about the Sussex mailing list