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