final ReportTarget target,
final ExpressionRuntime runtime)
throws DataSourceException
{
final AttributeMap attributes = collectAttributes(node, runtime);
CSSDeclarationRule rule = null;
final AttributeMap retval = new AttributeMap();
final String[] attrNamespaces = attributes.getNameSpaces();
for (int i = 0; i < attrNamespaces.length; i++)
{
final String namespace = attrNamespaces[i];
final Map attributeMap = attributes.getAttributes(namespace);
if (attributeMap == null)
{
continue;
}
final NamespaceDefinition nsDef = target.getNamespaceByUri(namespace);
final Iterator attributeIt = attributeMap.entrySet().iterator();
while (attributeIt.hasNext())
{
final Map.Entry entry = (Map.Entry) attributeIt.next();
final String key = (String) entry.getKey();
if (isStyleAttribute(nsDef, node.getType(), key))
{
final Object styleAttributeValue = entry.getValue();
rule = processStyleAttribute(styleAttributeValue, node, runtime,
rule);
}
else
{
retval.setAttribute(namespace, key, entry.getValue());
}
}
}
// Just in case there was no style-attribute but there are style-expressions
if (rule == null)
{
rule = processStyleAttribute(null, node, runtime, rule);
}
if (rule != null && rule.getSize() > 0)
{
retval.setAttribute(Namespaces.LIBLAYOUT_NAMESPACE, "style", rule);
}
return retval;