[Zope] Stop zope from adding <html><head></head> to my method

Oliver Wrede owrede@khm.de
Fri, 25 Feb 2000 17:49:41 +0100


on 25.02.2000 16:58 Uhr, Ibaņez Palomar Juan David at
al028823@alumail.uji.es wrote:

>> 
>> Hi,
>> 
>> I have a method in my product called getXML which builds an XML file
>> from subtree. However, zope keeps adding the text <html><head></head> to
>> the start of my xml, how do I stop it?
>> 
>> best,
>> Jacob
>> 
> 
> It's not zope, it's the browser who adds "<html><head></head>".
> 
> I've written a class which does the same thing, it has
> two methods toXML/fromXML, if you want you can download
> it from "www.zope.org/Members/jdavid/xmlio" (there is no
> documentation).  Other way to do the same thing is explained
> in "http://www.xml.com/pub/2000/02/23/zope/index.html".
> 
> Please, could you show me your code (the getXML method)? Just
> to join efforts, perhaps we could build something useful for
> others.

I think I solved the problem simply by explicitly secifying the Content-Type
of the object, which ist returned:

<dtml-call "RESPONSE.setHeader('Content-Type', 'text/xml')">
<?xml version="1.0"?>

... bla bla bla ...


Does that help?

Oliver




.. Oliver Wrede
.. owrede@khm.de

.. Academy of Media Arts, Cologne
.. Peter-Welter-Platz 2 . 50676 Koeln, Germany
.. http://www.khm.de
.. ICQ# 6580315
.. PGP 6.0 Fingerprint:
.. 922C FFA2 9A07 5B8E CB2A  10A2 C370 6A62 2232 196C