use of eu.esdihumboldt.hale.io.xslt.XslTypeTransformation in project hale by halestudio.
the class XsltGenerator method generateTypeTransformation.
/**
* Generate a XSL fragment for transformation based on the given type
* relation.
*
* @param templateName name of the XSL template
* @param typeCell the type relation
* @param targetfile the target file to write the fragment to
* @param targetElement the target element to use to hold a transformed
* instance
* @throws TransformationException if an unrecoverable error occurs during
* the XSLT transformation generation
*/
protected void generateTypeTransformation(String templateName, XmlElement targetElement, Cell typeCell, File targetfile) throws TransformationException {
XslTypeTransformation xslt;
try {
xslt = XslTypeTransformationExtension.getInstance().getTransformation(typeCell.getTransformationIdentifier());
} catch (Exception e) {
throw new TransformationException("Could not retrieve XSLT transformation generator for cell function", e);
}
xslt.setContext(context);
xslt.generateTemplate(templateName, targetElement, typeCell, new FileIOSupplier(targetfile));
}
Aggregations