Even if your knowledge of XML and Python is not advanced I hope that by now you got an idea on how to implement a simple XML parser in Python. Of course this was just a very simple example to illustrate the possibilities of the xml.sax module of Python.
Here follow some ideas, based on our example, for further exploration:
Try to load the <select> list on our web form dynamically from the XML document; that is to parse the document and to present the player names found as elements of the list.
In our example we mentioned nothing about proper XML syntax and similar matters. In production applications things do not always turn out as we would hope. This is why exception handling should always be part of your application. You can try to use one or more exception classes to handle the behaviour of your script as soon as an error occurs, by –for example- showing the appropriate error message.