@turbogears.expose(template="getest.templates.kml" format="xml") should work.
On 2/16/06, Tom Weir <[EMAIL PROTECTED]> wrote: > > Hi All, > > I'm just starting to experiment with TurboGears. On of the first things > I'm trying to do is to output KML; the XML format supported by Google > Earth. I'm having some problems getting the correct output. Could > anyone steer me in the correct direction. > > I've taken the stock quickstart app, an made the following changes. > > I added the following to controllers.py: > > class Root(controllers.Root): > @turbogears.expose(html="getest.templates.welcome") > def index(self): > import time > return dict(now=time.ctime()) > > @turbogears.expose(html="getest.templates.kml") > def kml(self,BBOX=None): > return dict(bbox=BBOX,tg_format="xml") > > I created a kml.kid template with the following: > <?xml version="1.0" encoding="UTF-8"?> > <kml xmlns="http://earth.google.com/kml/2.0" > xmlns:py="http://purl.org/kid/ns#"> > <node py:replace="bbox"/> > </kml> > > When I view the url (localhost:8080/kid) in the browser, I get the > following: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > <ns1:kml> > </ns1:kml> > <br/><br/>Build time: 0.140s, Page size: 0.12KB > > It looks like master.kid is somehow being pulled into the mix, even > though kml.kid doesn't extend it. Do I need to change anything? > > Thanks for your help, > > Tom > > > > -- cheers elvelind grandin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

