public static String evaluateExtensionAttribute(QName attName, XProcRuntime runtime, XStep step) {
String val = step.getExtensionAttribute(attName);
if (val != null) {
if (val.contains("{")) {
try {
val = evaluateAVT(val, runtime, step);
} catch (Exception e) {
final SourceLocator[] location
= new SourceLocator[]{XProcException.prettyLocator(null, -1, "@"+attName.toString())};
Throwable cause = new XProcException(e.getMessage(), e) {
@Override
public SourceLocator[] getLocator() {
return location; }};
throw new XProcException("Could not evaluate " + attName + " attribute: " + val, cause);
}
}
}
return val;
}