Guest User

Untitled

a guest
Mar 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <store>
  2. <bookstore>
  3. <book>
  4. <title lang="en">IT book</title>
  5. <author>Some IT Guy</author>
  6. </book>
  7. </bookstore>
  8. </store>
  9.  
  10. root = et.parse('Template.xml').getroot()
  11. bookstore = root.find('bookstore')
  12. book = root.find('bookstore').find('book')
  13.  
  14. for bk in bks:
  15. book.find('Title').text = bk
  16. books.append(book)
  17.  
  18. book[0].append(book) and book[-1].append(book)
Add Comment
Please, Sign In to add comment