OpenOffice-OODoc - getXMLContent as output filter

Posted on Thu Sep 15 23:56:20 2005 by bob
getXMLContent as output filter
I am not very familiar with XML or Open Office but certainly appreciate the modules which have been made available to all of us.

In the Introduction I noticed a reference to the getXMLContent method:

Note: A document is always saved in the same file format as it's source. The save() can't act as a format converter. So, you can't save an OOo 1.0 file in OASIS OpenDocument format and vice versa, and you can't directly (without intermediate processing) save in OOo/OpenDocument compressed format a document loaded from XML data. However, thanks to the getXMLContent() method, you can write the flat XML to the standard output or a given file handle.

When I try to use that method to send the contents of an Open Office file to my browser, I receive a malformed header error message. The output begins:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE office:document-content PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "office.dt +d"> <office:document-content office:class="text" office:version="1.0" xmlns:chart="http://openoffice.or +g/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:draw="http://openoffice.org/2000/ +drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:form="http://openoffice.org/2000/form" + xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:number="http://openoffice.org/2000/datastyl +e" xmlns:office="http://openoffice.org/2000/office" xmlns:script="http://openoffice.org/2000/scrip +t" xmlns:style="http://openoffice.org/2000/style" xmlns:svg="http://www.w3.org/2000/svg" xmlns:tab +le="http://openoffice.org/2000/table" xmlns:text="http://openoffice.org/2000/text" xmlns:xlink="ht +tp://www.w3.org/1999/xlink"> <office:script/> <office:font-decls><style:font-decl fo:font-family="Tahoma" style:name="Tahoma1"/><style:font-decl +fo:font-family="'Arial ...


Is there a way to use the getXMLContent as a filter to convert Open Office files to something displayable in a browser ?

Thank you in advance for any help.
Bob
Direct Responses: 1003 | Write a response