String transformAttributeValue = transformElement.attributeValue("Transform");
Matcher matcher = ATTRIBUTE_VALIDATOR_PATTERN.matcher(transformAttributeValue);
if (!matcher.matches())
throw new XdtException("The Transform Attributes value is invalid" + transformAttributeValue);
if (LOG.isDebugEnabled()) {
LOG.debug("Current Element XPath : {}", transformElement.getPath());
LOG.debug("Current Element Action : {}", matcher.group(1));
LOG.debug("Current Element Parameter : {}", matcher.group(3));
}
try {
Class<?> transformClass = Class.forName("be.hikage.xdt4j.transform." + matcher.group(1) + "Transform");
Constructor constructor = transformClass.getConstructor(Document.class, Element.class, String.class);
Transform instance = (Transform) constructor.newInstance(workingDocument, transformElement, matcher.group(3));
return instance;
} catch (Exception e) {
throw new XdtException("TODO : Exception handling", e);
}
}