It still give error,
Below is my code:
Below is my code:
[python][python]import xml.etree.cElementTree as ET tree = ET.ElementTree('input.xml') root = tree.getroot() for books in root: if (books.tag=='book'): print books.get('id') % here it says invalid syntax for attr in books: if (attr.tag=='author'): print (attr.text)[/python][/python]