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.

eZ debug

Timing: Jan 18 2025 11:17:15
Script start
Timing: Jan 18 2025 11:17:15
Module start 'layout'
Timing: Jan 18 2025 11:17:15
Module start 'content'
Timing: Jan 18 2025 11:17:16
Module end 'content'
Timing: Jan 18 2025 11:17:16
Script end

Main resources:

Total runtime1.3429 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.0391152.6406
Module start 'layout' 0.00720.0040 740.679739.4922
Module start 'content' 0.01121.3303 780.1719521.5703
Module end 'content' 1.34140.0014 1,301.74228.1250
Script end 1.3429  1,309.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2670160.0002
Check MTime0.00130.0969160.0001
Mysql Total
Database connection0.00140.103210.0014
Mysqli_queries1.293396.3061540.0240
Looping result0.00060.0439520.0000
Template Total1.300396.820.6502
Template load0.00220.161720.0011
Template processing1.298196.663220.6491
Template load and register function0.00010.011010.0001
states
state_id_array0.00170.123310.0017
state_identifier_array0.00090.069320.0005
Override
Cache load0.00180.1322120.0001
Sytem overhead
Fetch class attribute can translate value0.00110.078820.0005
Fetch class attribute name0.00090.069230.0003
XML
Image XML parsing0.00070.049420.0003
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00080.0620170.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs