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

Loren Stafford lstaffor@dynalogic.com
Fri, 25 Feb 2000 09:10:53 -0800


I don't have experience with this, but it's come up on this list before, so
here's what I remember. Maybe you can find more by searching up-list.

It's Zope. If it doesn't know the content-type, it guesses by scanning the
doc. XML looks like HTML to this simple scanner. Either you explicitly set
the content-type in RESPONSE, or there's some kind of junk you can put at
the top of the doc that will tip off the scanner.

-- Loren

----- Original Message -----
From: Jacob Gorm Hansen <jg@ioi.dk>
To: <zope@zope.org>
Sent: February 25, 2000 08:42 AM
Subject: Re: [Zope] Stop zope from adding <html><head></head> to my method


> "Ibaņez Palomar Juan David" wrote:
>
> > It's not zope, it's the browser who adds "<html><head></head>".
>
> Hmm not sure about that, lynx -source gives the same result as netscape.
>
> my top level object has the following getXML-method (not useable for
> other than my own small application):
>
>         def getXML(self):
>                 """ """
>                 r = '<?xml version="1.0"?>\n<project id="%s">' % self.id
>                 for i in self.objectValues():
>                         if(i.id != 'acl_users'):
>                                 r = r  + i.getXML()
>                 return r + '</project>\n'
>
> Do I have to somehow change the content-type for my method, or what goes
> wrong?
>
> Best,
> Jacob
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>