If you app is called "yourapp" and you put this file in applications/yourapp/views/default/kml.html
you also need to edit applications/yourapp/controllers/default.py and add an action def kml(): placemarks=db(...).select(....) ## fill the ... return dict(placemarks=placemarks) then you visit http://127.0.0.1:8000/yourapp/default/kml this calls the action, the action calls the view file. Hope this helps. I am not sure I understood the question. Massimo On Apr 22, 5:37 pm, Tim Michelsen <timmichel...@gmx-topmail.de> wrote: > Hello, > I would like to use the following how-to to generate a kml file from my > data base selection: > > Better Python Practices for the > GeoWebhttp://sgillies.net/blog/584/better-python-practices-for-the-geoweb/ > > <?xml version="1.0" encoding="utf-8"?> > <kml > xmlns="http://earth.google.com/kml/2.1" > xmlns:py="http://genshi.edgewall.org/" > > > <Folder> > <Style id="fireIcon"> > <IconStyle> > <Icon> > <href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href> > </Icon> > </IconStyle> > </Style> > <Placemark py:for="item in collection"> > <name py:content="item['name']">NAME</name> > <styleUrl>#fireIcon</styleUrl> > <description py:content="item['description']"> > DESCRIPTION > </description> > <Point> > <coordinates py:content="item['coordinates']"> > LONG,LAT > </coordinates> > </Point> > </Placemark> > </Folder> > </kml> > > I created a function that works in other files called "kml". > > Now created a file kml.kml in views/default: > > <?xml version="1.0" encoding="utf-8"?> > <kml > xmlns="http://earth.google.com/kml/2.1" > > > <Folder> > <Style id="fireIcon"> > <IconStyle> > <Icon> > <href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href> > </Icon> > </IconStyle> > </Style> > {{for placemark in placemarks:}} > <Placemark> > <name >{{=placemark.name}}</name> > <styleUrl>#fireIcon</styleUrl> > <description"> > {{=placemark.description}} > </description> > <Point> > <coordinates > > {{=placemark.lon}}, {{=placemark.lat}} > </coordinates> > </Point> > </Placemark> > {{pass}} > </Folder> > </kml> > > But when I enter the URL in the browser I get an invalid request. > Why? > If I rename the file to kml.html it returns the query result only. > > How do I need to change my controller that web2py delivers xml using my > kml.kml template file? > > Thanks in advance, > Timmie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---