Just as a follow-up on acknak's hint to create a simple xslt stylesheet to solve this ...
acknak wrote:If you really only want the document content, it's very simple to create an XSLT that sends its input (content.xml) to the output, unchanged. You can install that as an xml filter and the user can export the data using the normal File > Save/Save As menu.
XSLT has the copy-of element to make a deep copy of a node. If you do this for the root node you'll have a direct copy of the full xml input. Most of the introductions on XSLT have a stylesheet similar to the following one as their first example:
Code: Select all
<?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" indent="yes" encoding="utf-8" />
<xsl:template match="/">
<xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet>
Save the above code to a raw-export.xslt or direct-copy.xslt or whatever suits you (delete the
indent="yes" if you don't need the output to be human readable) and use the xml-filter dialog from Tools to configure this for as an export filter. It should basically work for all kind of OOo documents (text, spreadsheets, presentations, etc.) but the filter dialog requires you to specify a type. Either do this for all types that you need or maybe "unknown" can do the job as well. But I tested it only for .odt documents.
After this you can use "Export..." from the file menu to export to an xml file. The output of an Writer document contains the xml from meta.xml, settings.xml, styles.xml and content.xml:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<office:document ... office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta>...</office:meta>
<office:settings>...</office:settings>
<office:scripts>...</office:scripts>
<office:font-face-decls>...</office:font-face-decls>
<office:styles>...</office:styles>
<office:automatic-styles>...</office:automatic-styles>
<office:master-styles>...</office:master-styles>
<office:body>...</office:body>
</office:document>
I have never used the flat odt (.fodt) extension, but from what I read about it it seems to output more or less the same structure.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.