{
ruleMap.clear();
Iterator it = rules.iterator();
while (it.hasNext())
{
Rule rule = (Rule)it.next();
ruleMap.put(rule.getId(), rule);
}
tagMap.clear();
it = tags.iterator();
while (it.hasNext())
{
Tag tag = (Tag)it.next();
tagMap.put(tag.getId(), tag);
Iterator attributes = tag.getAttributes().iterator();
while (attributes.hasNext())
{
Attribute attribute = (Attribute)attributes.next();
if (attribute instanceof AttributeImpl)
{
String ruleId = ((AttributeImpl)attribute).getRuleId();
Rule rule = (Rule)ruleMap.get(ruleId);
if (rule != null)
{
attribute.setRule(rule);
}
}