throws UnableToCompleteException {
Map<String, String> attNameToToken = new HashMap<String, String>();
for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
XMLAttribute att = elem.getAttribute(i);
AttributeParser parser = writer.getBundleAttributeParser(att);
if (parser != null) {
// Legacy res:style='style.pretty'
String parsedValue = parser.parse(att.consumeRawValue(),
writer.getLogger());
String attToken = writer.tokenForExpression(parsedValue);
// Use localName so <div res:style='...'> becomes <div style='...'>
attNameToToken.put(att.getLocalName(), attToken);