May 27, 2004
I'm running Debian, I'm playing with XML and I would really, really like to convert my nice valid document into a popular document format. The format of choice would be RTF. Any suggestions? Java solutions are out, mainly for political reasons, sorry folks.
May 24, 2004
Editing XML in VIM
Validating an XML document against its DTD
Luckily, there is a Python Cookbook recipe that shows us how to achieve it with xmlproc.
May 21, 2004
Python and XML
I have to admit that I really don't like this book, published by O'Reilly and authored by Christopher A Jones and Fred L Drake Jr. There are a few reasons, the prose is pedestrian, the examples not very useful and the structure somewhat confusing.
Taking my last point first, the book gives an explanation of both Python and XML (good), outlines (far too briefly) the available toolkits. Then it explains that there are two different approaches to manipulating XML documents and attempts to explain each (primarily SAX and DOM). In quite a few cases the book reads like a precis of the official (or definitive) specification without enough detail to be worth reading. At these points there is generally a pointer to an (unreadable in my opinion) W3C specification.
A weakness of the book is that it doesn't at any point suggest what each approach's strengths and weaknesses are. Nor, really, do they attempt to address what XML is best used for, or what Python adds to the mix.
There are a number of implicit assumptions, I think, in the book. The first and most significant is that you approach it with a specific task or problem domain in mind. If you are searching for answers to "why" type questions (why should I use SAX? for instance) you will be sadly dissapointed. The how questions are addressed though.
The single thing that would improve this book though is some decent examples. My preference is for meaningful, incremental examples throughout technical books like this. They are hard to do though. But how hard would it be, for instance, to mention that XML is often used for configuration (e.g. in wxPython) and suggesting a few different ways of building and parsing these type of files?
Finally, and I'm sorry that this is so negative, the book is just plain wrong in a number of places. Today I wanted to find a way of validating an XML file against it's DTD. I looked it up in the book and the subject is mentioned in the index. Turning to page 151 I see a section on validating DTDs. There is no explanation of the principle though, just a suggestion that you use a utility script which is part of the xmlproc parser that ships with the PyXML utilities. Except it doesn't. There is no xvcmd.py shipped with version 0.8.3 (the current release) and frankly I can't be bothered looking in previous releases. This is also the only mention of xmlproc in the book, which is strange because it it the first thing mentiond on the PyXML home page, but obviously not important enough to feature in the book at all.
My advice? If you want to learn about XML and the ways it can be written, read and manipulated go to XML.com and if you want to work with XML in Python you can't beat the effbot's ElementTree toolkit. Which naturally isn't mentioned in the book.
May 19, 2004
Getting Better Every Day
May 17, 2004
My sister in law has roped me in to build a web site for her daughter's creche. Since they won't want to rely on me to maintain it for them I need to set up a simple, single page brochure site hosted in the UK (they have a .uk domain) which is easy to maintain. Did I mention that it will need to be easy to maintain because the people looking after it aren't technical at all? I did, good.
After I've developed the site for them I'm probably going to suggest they use CityDesk for maintenance. They will need somewhere to host the site though. Does anyone have any suggestions? The site will be small and the bandwidth minimal. The creche is a registered charity, so if we can find someone who does free hosting for non-profit organisations all the better.
May 10, 2004
It has the advantage of being local, only a day, and within the realms of possibility for getting a baby sitter. I bet Simon will be there as well, it sounds right up his street.