XML mapping to Database
I don't know if anyone can help me with this. But can anyone tell me how can I map an XML script into mysql database? Lets say the web service provider has a XML script that returns the hotel classifications. Instead of running this script everytime I run a 开发者_StackOverflow社区search query, I want it to save into the database and use the database table instead of the XML script. Can anyone help me with this?
You shouldn't work with XML from a webservice directly. Use a proxy class which automatically serialize and desearialize the XML for you into a "Hotel" object.
Put your XMl into a SimpleXMLElement
object. You can find an example of how to do that via my answer here.
精彩评论