if ("Resource".equals(atFunction))
{
//TODO I am assuming that this should always be a string type because this is
// XML, though @Resources allow things like Embed. I'm right?
//TODO test an Embed and see what happens?
final AtResource atResource
= (AtResource)textParser.resource(text, typeTable.stringType);
if (atResource != null)
{
// C: only localPart as the key?
attributeResources.put(qname, atResource);
// we don't remove these here since we don't want to reorder the attributes
// we also don't call addAttribute() to update the map to avoid a potential
// ConcurrentModificationException on the iterator
//i.remove();
}
}
else if (atFunction != null)
{
// if we found an invalid @Function, throw an error
textParser.desc = atFunction;
textParser.line = node.beginLine;
textParser.error(TextParser.ErrUnrecognizedAtFunction, null, null, null);
}
}
// now update the definitions in the attribute map
for(Iterator<QName> iter = attributeResources.keySet().iterator(); iter.hasNext();)
{
final QName qname = iter.next();
final AtResource atResource = attributeResources.get(qname);
// attributes are in a LinkedHashMap, so this just updates the existing mapping
// with the qname -> AtResource. When Element.toStartElement() is emitting the
// attribute's value, it will notice the special case of an AtResource object
// (instead of String) and emit an E4X expression with braces rather than a