if (null == ruleset)
{
return;
}
Tag tag = ruleset.getTag(tagid.toUpperCase());
if (null == tag)
{
return;
}
Iterator attribRules = tag.getAttributes().iterator();
while (attribRules.hasNext())
{
Attribute attribute = (Attribute)attribRules.next();
String name = attribute.getId();
String value = (String)attributes.getValue(name);
//String id = (String)attributes.getValue("name");
//System.out.println("id = " + id);
//System.out.println("value = " + value);
//System.out.println("name = " + name);
if (value != null) // && name.equalsIgnoreCase(attribute.getId()))
{
Rule rule = attribute.getRule();
if (null == rule)
{
continue;
}
if (!rule.shouldRewrite(value))
{
continue;
}
String rewritten = rewriteUrl(value, tag.getId(), name);
if (null != rewritten) // return null indicates "don't rewrite"
{
if (rule.getSuffix() != null)
{
rewritten = rewritten.concat(rule.getSuffix());