Fix xslt/html/javascript, http://stackoverflow.com/a/3542607