All of the effort will be in parsing the XML, so you should check the documentation of the various XML libraries and ask questions in their forums (or on Stack Overflow). The details will depend on the structure of your XML. Ultimately, you want to loop over the records in the XML, and for each record, build a dictionary where the keys are the DAL table field names and the values are the record values you want to insert. Once you have such a dictionary, the DAL insert for a single record is simple:
db.mytable.insert(**record_dictionary) Anthony On Friday, July 3, 2015 at 12:00:22 PM UTC-4, Sai Harsh Tondomker wrote: > > Thanks for replying. > Could you please give me one example. > > Waiting for your response > > > > > On Wednesday, July 1, 2015 at 7:56:17 PM UTC+5:30, Anthony wrote: >> >> You can parse the XML with something like ElementTree, lxml, or Beautiful >> Soup. Then you would have to write some code to extract the data for >> individual records (which will depend on the structure of the XML) and use >> the DAL to insert each record. >> >> Anthony >> >> On Wednesday, July 1, 2015 at 10:01:19 AM UTC-4, Sai Harsh Tondomker >> wrote: >>> >>> >>> My project is to make simple quizzing site. >>> >>> I have made data base in web2py. >>> >>> with Question, options and Correct answer. >>> >>> The data will be xml file. From XML file I need to take data and store >>> in data base >>> >>> Please help me to solve the problem. >>> >>> Waiting for your response. >>> >>> Best Regards >>> T.Sai Harsh >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

