final CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
if (value instanceof CSSResourceValue)
{
final CSSResourceValue cssResourceValue =
(CSSResourceValue) value;
final Resource resource = cssResourceValue.getValue();
return new ResourceContentToken(resource);
}
if (value instanceof CSSStringValue == false)
{
throw new FunctionEvaluationException
("Not even remotely an URI: " + value);
}
final CSSStringValue strval = (CSSStringValue) value;
final CSSResourceValue cssResourceValue =
FunctionUtilities.loadResource(layoutProcess, strval.getValue());
final Resource resource = cssResourceValue.getValue();
return new ResourceContentToken(resource);
}