[EMAIL PROTECTED] wrote: > I need a way for my program to unzip an ODT ,and merge all the xml files > into a single xml entity for storage in a document archive. The "program" > (actually several separate programs), currently takes only Word XP > documents, and extracts the XML, transforms that into a pdf, and stuffs > them both in a database record. I'd like to allow them to do the same with > ODF files. > I searched Google, to no avail.
You can create your own export filter in OOo that directly generates a single xml file for your document. Take the following xslt transformation: <?xml version='1.0' encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8"/> <xsl:template match="/"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> and store it into a file named "flat.xsl". Now go to "Tools-XML Filtersettings". Create a new filter, you will see a tab dialog. On the first page ("General") give your filter and your type a name of your choice (I used "flat" in both cases as we call this the "flat file format") and give it an extension of your choice (I chose "xml"). In the "Application" listbox select "OpenOffice.org Writer (odt)". On the second page ("Transformation") click the "Browse" button near "XSLT for export" and select the xsl file. Now press "OK". Close the XML filter settings dialog. You should now see a new filter in the "export" dialog of Writer named "flat(xml)" or however you named your format and your extension. Using this new export filter will store the whole Writer document into a single xml file. Beware! I can become quite huge for bigger documents. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
