adding application/xml type to xml generated with ez

Author Message

Rami Grossman

Tuesday 19 April 2005 12:27:27 am

I created a tpl file which generates xml file.
I clicked on the url which generates the file
(http://mydomain.com/mysite/content/view/xml/99)
even though the file content is xml apache didn't recognize it as xml and put on the header type - text/html. What I need is application/xml or text/xml. if I save with the browser (save page as) the file as file.xml and put it on the server and try to browse it apache knows its xml and put the right type. How can I generate xml file with ez with the right type?

Bård Farstad

Tuesday 26 April 2005 3:08:47 am

Rami, you need to write a module to do this. eZ publish sends these HTML headers by default and you need to override this manually. Currently there is no method of doing this via templates.

The module could simply fetch the node, display it with a template and return the XML and set headers. You can look at e.g. the OpenOffice.org extension, this has an export function which is very similar. Sets custom headers and generates XML.

--bård

Documentation: http://ez.no/doc

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.