Archive for October, 2007

Any XSLT/XPath experts out there? I’m a little bit stuck. I have a stylesheet that is effectively transforming XHTML into XHTML (best not to ask) and is matching any element with select = "xhtml:*". However, sometimes empty a elements creep into the original XHTML and get copied across to the output. These can play havoc with the CSS and JavaScript used on the final web page so I’d like to supress them.

How do I modify the select statement above to select all XHTML elements except for a elements that have either no text node children or have text node children composed solely of white space?

In other words if the input contains <a></a> or <a /> or <a> </a> then it should be skipped (assume for now that any attributes are irrelevant and that we’ll deal with the case where it contains another element node but no text nodes later).

I tried select = "xhtml:*[not(self::a[not(text())])][not(self::a[not(text() = ' ')])]" as a first stab but as well as being very ugly it doesn’t seem to be working. Any ideas?

Tags: ,

Haven’t we moved beyond this?

Very True Mood: (disappointed) disappointed

Saw The Lord of the Rings musical courtesy of work and the producers. It’s not really fair to call it a musical as it barely contains more songs than the books do, though the fight scenes are superbly choreographed to music. The producers prefer the term ‘spectacle’ and it fits that label very well. The design element is superb – Black Riders, Ents, Shelob, the Balrog are all achieved on stage in innovative but effective ways that you probably wouldn’t imagine. The use of crutches and prosthetics to distinguish the orcs may not be very politically correct but it does convey the twisted and deformed nature of their creation.

It’s quite long but still has to compress the story somewhat. The first act follows the first book reasonably closely (no Tom Bombardil, though he does get namechecked at the end, no Barrow Wights, no Glorfindel, and the Nazgul attacks on the Prancing Pony and Weathertop are combined), but after the interval things start to diverge rather more. I was starting to get suspicious when Boromir kept on talking about “The Kingdom of Men” rather than Gondor and it turned out that they had indeed combined Rohan and Gondor – and hence Theoden and Denethor, and Helm’s Deep and Pelennor Fields. Whilst this moved the plot along quite quickly it removed some of the subtlety from the story and a lot of “fan favourite” characters and scenes – no Eomer, no Eowyn, no Faramir, no Palantír, no Wormtongue, no Paths of the Dead, no Witch King. On the plus side they do, briefly, include the Scouring of the Shire.

The performances ranged from the very good to the very camp but even Malcolm Storry as an excellent Gandalf suffers somewhat in comparison with Ian McKellan in the films. In fact the hardest thing to keep in mind when reviewing or just watching the stage version is that it’s an independent adaptation of the book not the film. It aims for a very different feel – more mythic, more rooted in fairy tales, rather than the “realistic” fantasy of the films. In this sense it’s perhaps a little truer to the spirit of Tolkein even if it taks much bigger liberties with his story.


England beat Australia and France beat New Zealand?

Have I slipped into a parallel universe?

Very True Mood: (shocked) shocked

Via just about everyone. The 106 books most often tagged as unread on LibraryThing. Bold the ones you’ve read. Add an asterisk to the ones you’ve read more than once. Italicise the ones you’ve started but not finished. Strikethrough the ones you hated. Underline the ones on your “to read” list.

The list... )

Conclusions? I’m way behind on my Neal Stephenson reading, and I haven’t read many ‘classics’ but nor have a lot of other people.

Very True Mood: (okay) okay
Very True Music: Turn It On - Ladytron

Heavy rain and other extreme weather conditions can affect the speed of your broadband connection. In some cases this may also cause connection problems. You should bear this in mind before reporting a broadband fault.

Very True Mood: (confused) confused