How To Efficiently Store This Parsed Xml Document In Mysql Database Using Python?
Following is the XML file : book.xml Sam
Solution 1:
Based on your comment above, I would simply create a book class, an author class, an author list, and a chapter class. Assign the chapters of the book to a list of Chapter objects on the Book itself. Maintain the AuthorList as a dict of their IDs, pointing to the actual Author objects. Use a data member of the Book object to contain the ID; you can provide a method to pull the author out of the AuthorList dict for convenience.
Post a Comment for "How To Efficiently Store This Parsed Xml Document In Mysql Database Using Python?"