[Zope] Z class complexities

Maik Roeder roeder@berg.net
Sun, 01 Oct 2000 18:02:18 +0200


Hi Nolan !

Nolan Darilek wrote:
> 
> I'm having a kinda complex problem, and hopefully my explanation can
> do it justice. :)
> 
> I'm using zope to construct an XML document from the contents of a
> folder. Basically, the folder's index.xml iterates through the
> folder's contents, rendering each object to produce the final
> document. The objects are separate z classes which combine various
> properties into a small snippet of the larger XML document.
> 
> The z class has a render() method which combines the properties into
> the XML snippet. I have a Render view configured to run this method,
> and it works. (Though for some reason it adds a <html><head>..., which
> I'd really like to get rid of. How can I?)

Attach the following code:

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

> I've written the index_html to collect the individual objects and
> concatenate their contents into an XML document. 
> 
> <?xml version="1.0"?>
> <espsetup-list>
> <dtml-in "PARENTS[0].objectValues('ESPPackage')" sort=title>
> <dtml-var "_[_['id']].render()">
> </dtml-in>
> </espsetup-list>
> 

Something like this should work if you have a DTML Method to_xml:

<?xml version="1.0"?>
<dtml-in "objectValues('ESPPackage')" sort=title>
<dtml-var to_xml>
</dtml-in>
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/xml')">

Place the to_xml in the ESPPackage ZClass

Regards,

Maik Röder

-- 
Uzopia - Digging la vida Zopa - http://uzopia.editthispage.com