token.setType (Type.ATTRIBUTE);
parseName ("attribute");
if (pos == token.getStartOffset())
throw new XMLParseException ("Expected attribute name", source, pos);
skipWhiteSpace ();
expect ('=');
skipWhiteSpace ();
char c = 0;
if (pos < source.length ())
c = source.charAt (pos);
if (c != '\'' && c != '"')
throw new XMLParseException ("Expected single or double quotes", source, pos);
char endChar = c;
while (true)
{
pos ++;
if (pos >= source.length ())
{
int i = Math.min (20, source.length () - token.getStartOffset ());
throw new XMLParseException ("Missing end quote ("+endChar+") of attribute: "
+lookAheadForErrorMessage (null, token.getStartOffset (), i), token);
}
c = source.charAt (pos);
if (c == endChar)