I’ll hold an introductory XML-workshop tomorrow: a little DOM, a little SAX, why and how to validate… things like that. And of course there is no easier way to illustrate those concepts than with Python.
It takes just a few minutes to install Python 2.0, the Win32 extensions and the latest version of pyXML – but this slick little installation gives me exactly the kind of small, readable and tweakable samples I want. And very easy COM-automation of Internet Explorer and MSXML, too:
from win32com.client import Dispatch
xmldoc = Dispatch("Msxml2.domdocument")
xmldoc.async = 0
xmldoc.validateOnParse = 1
if (xmldoc.load('sample.xml')):
print 'OK'
else:
print 'No good!'
Unfortunately, I have been very busy with other things today, so preparations will prevent me from sleeping as much as I’d like to tonight. But that’s life, sometimes.