}
ListValue result = new ListValue();
for (;;) {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_STRING_VALUE:
result.append(new StringValue(CSSPrimitiveValue.CSS_STRING,
lu.getStringValue()));
lu = lu.getNextLexicalUnit();
break;
case LexicalUnit.SAC_IDENT:
StringBuffer sb = new StringBuffer(lu.getStringValue());
lu = lu.getNextLexicalUnit();
if (lu != null &&
lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
do {
sb.append(' ');
sb.append(lu.getStringValue());
lu = lu.getNextLexicalUnit();
} while (lu != null &&
lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT);
result.append(new StringValue(CSSPrimitiveValue.CSS_STRING,
sb.toString()));
} else {
String id = sb.toString();
String s = id.toLowerCase().intern();
Value v = (Value)values.get(s);
result.append((v != null)
? v
: new StringValue
(CSSPrimitiveValue.CSS_STRING, id));
}
}
if (lu == null) {
return result;