See the discussion on whitespace above for why I use getAttribute here.