wrap attribute setting in try/catch to avoid bailing on terrible markup