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: ,

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.


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.

  • Jonathan Strange & Mr Norrell
  • Anna Karenina
  • Crime and Punishment
  • Catch-22
  • One Hundred Years of Solitude
  • Wuthering Heights
  • The Silmarillion*
  • Life of Pi: A Novel
  • The Name of the Rose
  • Don Quixote
  • Moby Dick
  • Ulysses
  • Madame Bovary
  • The Odyssey
  • Pride and Prejudice
  • Jane Eyre
  • The Tale of Two Cities
  • The Brothers Karamazov
  • Guns, Germs, and Steel: The Fates of Human Societies*
  • War and Peace
  • Vanity Fair
  • The Time Traveler’s Wife
  • The Iliad
  • Emma
  • The Blind Assassin
  • The Kite Runner
  • Mrs Dalloway
  • Great Expectations
  • American Gods
  • A Heartbreaking Work of Staggering enius
  • Atlas Shrugged
  • Reading Lolita in Tehran: A Memoir in Books
  • Memoirs of a Geisha
  • Middlesex
  • Quicksilver
  • Wicked: The Life and Times of the Wicked Witch of the West
  • The Canterbury Tales
  • The Historian: A Novel
  • A Portrait of the Artist as a Young Man
  • Love in the Time of Cholera
  • Brave New World
  • The Fountainhead
  • Foucault’s Pendulum
  • Middlemarch
  • Frankenstein
  • The Count of Monte Cristo
  • Dracula
  • A Clockwork Orange
  • Anansi Boys
  • The Once and Future King*
  • The Grapes of Wrath
  • The Poisonwood Bible: A Novel
  • 1984
  • Angels & Demons
  • The Inferno
  • The Satanic Verses
  • Sense and Sensibility
  • The Picture of Dorian Gray
  • Mansfield Park
  • One Flew Over the Cuckoo’s Nest
  • To the Lighthouse
  • Tess of the D’Urbervilles
  • Oliver Twist
  • Gulliver’s Travels
  • Les Misérables
  • The Corrections
  • The Amazing Adventures of Kavalier and Clay
  • The Curious Incident of the Dog in the Night-Time
  • Dune*
  • The Prince
  • The Sound and the Fury
  • Angela’s Ashes: A Memoir
  • The God of Small Things
  • A People’s History of the United States: 1492-Present
  • Cryptonomicon
  • Neverwhere
  • A Confederacy of Dunces
  • A Short History of Nearly Everything
  • Dubliners
  • The Unbearable Lightness of Being
  • Beloved
  • Slaughterhouse-Five
  • The Scarlet Letter
  • Eats, Shoots & Leaves
  • The Mists of Avalon
  • Oryx and Crake: A Novel
  • Collapse: How Societies Choose to Fail or Succeed
  • Cloud Atlas
  • The Confusion
  • Lolita
  • Persuasion
  • Northanger Abbey
  • The Catcher in the Rye
  • On the Road
  • The Hunchback of Notre Dame
  • Freakonomics: A Rogue Economist Explores the Hidden Side of Everything
  • Zen and the Art of Motorcycle Maintenance: An Inquiry into Values
  • The Aeneid
  • Watership Down
  • Gravity’s Rainbow
  • The Hobbit*
  • In Cold Blood: A True Account of a Multiple Murder and its Consequences
  • White Teeth
  • Treasure Island
  • David Copperfield
  • The Three Musketeers

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.