dianping/cat · error · Error
attribute value missed!!
Error message
attribute value missed!!
What it means
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.
Source
Thrown at cat-home/src/main/webapp/assets/js/editor/worker-xml.js:1589
value = source.slice(start,p);
if(value.slice(-1) === '/'){
el.closed = true;
value = value.slice(0,-1)
}
case S_ATTR_S:
if(s === S_ATTR_S){
value = attrName;
}
if(s == S_V){
errorHandler.warning('attribute "'+value+'" missed quot(")!!');
el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start)
}else{
errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
el.add(value,value,start)
}
break;
case S_EQ:
throw new Error('attribute value missed!!');
}
return p;
case '\u0080':
c = ' ';
default:
if(c<= ' '){//space
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));//tagName
s = S_S;
break;
case S_ATTR:
attrName = source.slice(start,p)
s = S_ATTR_S;
break;
case S_V:
var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
errorHandler.warning('attribute "'+value+'" missed quot(")!!');View on GitHub (pinned to e815e74d4c)
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.
Example fix
<!-- before --> <button disabled=>OK</button> <!-- after --> <button disabled="disabled">OK</button>
Defensive patterns
Strategy: validation
Validate before calling
// Every '=' inside a start tag must be followed by a value:
function equalsHaveValues(tagText) {
return !/=\s*(>|$)/.test(tagText);
} Try / catch
try {
parseStartTag(source, start, tagNameReplacer);
} catch (ex) {
if (/attribute value missed/.test(ex.message)) reportXmlError(ex); else throw ex;
} Prevention
- 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.
When it happens
Trigger: '<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.
Common situations: 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=${}>'.
Related errors
- attribute equal must after attrName
- attribute value must after "="
- invalid attribute:{qName}
- attribute value no end '{c}' match
- attribute invalid close char('/')
AI-assisted analysis of dianping/cat@e815e74d4c (2026-08-14).
Data as JSON: /api/errors/a664a7ed2042cf80.
Report an issue: GitHub.