Let's say you have:
def mp3():
rows = db(your_query).select(your_select)
return dict(rows=rows)
If you go to /app/controller/mp3.xml it will use the 'generic.xml' view to
render the rows as XML. If you want to convert the rows to XML within your
controller and then do something else with the XML, you can do:
from gluon.serializers import xml
xmlrows = xml(rows)
The above is what the 'generic.xml' view file does.
Anthony
On Friday, April 15, 2011 8:49:07 AM UTC-4, 黄祥 wrote:
> hi,
>
> is there anyone knows how to produce db output select into xml please?
> my intention is to convert my audio mp3 table into xml and then put it
> on web2py apps.
>
> e.g. (source from : http://www.voice2page.com/info/v2ppage_codes.html)
>
> <embed allowScriptAccess="never"src="http://voice2page.com/info/
> mp3player.swf" menu="false" quality="high" width="264" height="280"
> name="index" type="application/x-shockwave-flash" pluginspage="http://
> www.macromedia.com/go/getflashplayer" flashvars="playList=http://
> ***your_url***/
> ***your_playlist***.xml&ShowPlaylist=1&ShowEQ=1&firstTrack=1&initVol=80"
> wmode="transparent" border="0" /></embed>
>
> or is there any other way to do that?
>
> thanks so much and best regards,
>
> steve van christie