{"record":{"id":"a664a7ed2042cf80","repo":"dianping/cat","slug":"attribute-value-missed","errorCode":null,"errorMessage":"attribute value missed!!","messagePattern":"attribute value missed!!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/editor/worker-xml.js","lineNumber":1589,"sourceCode":"\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed  = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_S:\n\t\t\t\tif(s === S_ATTR_S){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_V){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\tel.add(attrName,value.replace(/&#?\\w+;/g,entityReplacer),start)\n\t\t\t\t}else{\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\tel.add(value,value,start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_S;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_S;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_V:\n\t\t\t\t\tvar value = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');","sourceCodeStart":1571,"sourceCodeEnd":1607,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/editor/worker-xml.js#L1571-L1607","documentation":"The attribute tokenizer reached the end of the start tag ('>' path) while still in state S_EQ (worker-xml.js:~1589): an attribute name and '=' were consumed but no value followed before the tag closed. Since there is nothing to attach, the parser throws this hard error rather than silently inventing a value.","triggerScenarios":"'<tag disabled=>' — equals sign immediately followed by '>'. Also '<tag a= b>' is tolerated as unquoted value 'b', but 'a= >' hits the S_EQ case at line 1587-1589. Common while typing.","commonSituations":"Mid-edit XML in the editor (typed '=' but not yet the value), HTML boolean-attribute habits ('disabled=') pasted into XML, templating placeholders like '<x v=${}>'.","solutions":["Supply a value after '=' or remove both '=' and the attribute: <tag disabled=\"disabled\"> or <tag>.","For boolean-ish attributes in XML, use a name=\"name\" pair or move to a schema that defines defaults.","If ${}-style placeholders are intentional, parse with a mode that supports the template language, not the plain XML worker."],"exampleFix":"<!-- before -->\n<button disabled=>OK</button>\n\n<!-- after -->\n<button disabled=\"disabled\">OK</button>","handlingStrategy":"validation","validationCode":"// Every '=' inside a start tag must be followed by a value:\nfunction equalsHaveValues(tagText) {\n  return !/=\\s*(>|$)/.test(tagText);\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseStartTag(source, start, tagNameReplacer);\n} catch (ex) {\n  if (/attribute value missed/.test(ex.message)) reportXmlError(ex); else throw ex;\n}","preventionTips":["In XML there are no boolean attributes — always name=\"value\".","Don't paste HTML boolean-attribute syntax into XML documents.","Guard template placeholders (e.g. attr=${x}) from the plain XML worker."],"tags":["xml","sax","ace-editor","attributes","parser"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}