Friends,
I implemented in the default controller a function called sitemap()
that have all logic to generate the sitemap.xml file, but I don't know
how to escape a string into a XML.
My sitemap() function:
def sitemap():
sitemap_xml = ''
'''
Here the logic to generate the content
'''
.
.
return dict(sitemap_xml=sitemap_xml)
Then, I create a page in views/default/sitemap.html:
{{extend 'site.html'}}
{{=sitemap_xml}}
Well, I need generate this page in XML format, how to do this ? I try
to do this: www.mysite.com/init/default/sitemap.xml but this generate
the tag 'document' and a tag to variable 'sitemap_xml' and this way
isn't a valid sitemap.xml file.
You can see in action: http://www.leandro.inf.br/init/default/sitemap.xml
Any idea ?
-- Leandro.
--
You received this message because you are subscribed to the Google Groups
"web2py-users" 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/web2py?hl=en.