Hi Michael, you´ll need to add indents (4 spaces or 1x tab) below the definition if this error comes up. To do this, select the content from line 6 to 11 and press tab key once. Also line 14 needs one indent (4 spaces or 1x tab), does it work ?
import clr
clr.AddReference("System.Xml")
import System.Xml
def XMLTest():
filename = r"C:\xmltest.xml"
xmldoc = System.Xml.XmlDocument()
xmldoc.Load(filename)
items = xmldoc.SelectNodes("data/items/item")
for item in items:
print item.InnerText
if __name__=="__main__":
XMLTest()
c.