Python's XML and Openoffice.org

Tim Evans t.evans at paradise.net.nz
Fri Feb 14 06:19:08 EST 2003


"Wouter van Marle" <wouterm at spammers-unite-here.com> writes:

> Hi all!
> 
> I learnt Python has libraries to access XML (haven't diven into it yet).
> And Openoffice.org also uses XML, right?
> 
> Now is there a way for Python to easily access openoffice files? And to
> convert them into postscript?
> 
> 
> What I want with this is the following: I am working on a fax application,
> one of the features I want to build in is a coverpage which is easily user
> editable. That they can include a header picture, some text, etc.
> Furthermore I want the user to be able to add tags (e.g. @F@ which can be
> replaced by the fax number).
> 
> What I ideally want is to simply read the text file line by line, replace
> the tags with my strings, write the changed line back to the file, convert
> it to postscript, and send it out. It would be perfect if the user can
> simply edit the file in openoffice.org, having all the powerfull layout and
> so from this suite. Of course the user could use <any> application that
> handles XML files to build up the cover page file.
> XML is ascii based, so the read-replace-write is in principle easy.
> Major thing: how to go from XML to ps? And how about the graphics?
> 
> Wouter.

It might be simpler to just do the substitutions in the .ps file
(postscript is ascii based too). I've used this method successfully to
paste a list of names into a page of name-tag templates, although not
with OOo produced postscript, so YMMV.

-- 
Tim Evans




More information about the Python-list mailing list