For simple parsing, you can also use the built-in TAG() helper -- see 
http://web2py.com/books/default/chapter/29/5#Parsing.

FYI, in your example, some of the closing tags do not match their 
associated opening tags.

Anthony

On Thursday, August 23, 2012 5:53:32 AM UTC-4, Amit wrote:
>
> Hi,
> I have web service method in my application which will receive xml file 
> from the request, i need to parse it and save the extracted data to the 
> database. Please suggest me the best way to parse xml in web2py.
>
> xml format would be like below:
>
> <?xml version='1.0' encoding='utf-8'?>
> <macaddress value="00:00:00:00:00:00" >
>   <devicetype value="abc">
>     <deviceserialno>123456</sensorserialno>
>     <mfgdate>2012-06-30</mngdate>
>     <mfgsiteid>1</mngsiteid>
>     <secretkey>adadafdfdgfgfhggjghjjj</secretkey>
>   </sensortype>
> </macaddress>
>

-- 



Reply via email to