use of org.apache.tools.ant.taskdefs.XSLTProcess in project ant by apache.
the class TraXLiaison method configure.
/**
* Specific configuration for the TRaX liaison.
* @param xsltTask the XSLTProcess task instance from which this liaison
* is to be configured.
*/
public void configure(final XSLTProcess xsltTask) {
project = xsltTask.getProject();
final XSLTProcess.Factory factory = xsltTask.getFactory();
if (factory != null) {
setFactory(factory.getName());
// configure factory attributes
for (final XSLTProcess.Factory.Attribute attr : Collections.list(factory.getAttributes())) {
setAttribute(attr.getName(), attr.getValue());
}
for (final XSLTProcess.Factory.Feature feature : factory.getFeatures()) {
setFeature(feature.getName(), feature.getValue());
}
}
final XMLCatalog xmlCatalog = xsltTask.getXMLCatalog();
// use XMLCatalog as the entity resolver and URI resolver
if (xmlCatalog != null) {
setEntityResolver(xmlCatalog);
setURIResolver(xmlCatalog);
}
// configure output properties
for (final XSLTProcess.OutputProperty prop : Collections.list(xsltTask.getOutputProperties())) {
setOutputProperty(prop.getName(), prop.getValue());
}
suppressWarnings = xsltTask.getSuppressWarnings();
traceConfiguration = xsltTask.getTraceConfiguration();
}
use of org.apache.tools.ant.taskdefs.XSLTProcess in project ant-ivy by apache.
the class IvyRepositoryReport method gen.
private void gen(ResolutionCacheManager cache, String organisation, String module, String style, String ext) {
XSLTProcess xslt = new XSLTProcess();
xslt.setTaskName(getTaskName());
xslt.setProject(getProject());
xslt.init();
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
xslt.setOut(new File(getTodir(), outputname + "." + ext));
xslt.setBasedir(cache.getResolutionCacheRoot());
xslt.setStyle(style);
xslt.execute();
}
use of org.apache.tools.ant.taskdefs.XSLTProcess in project ant-ivy by apache.
the class IvyRepositoryReport method genreport.
private void genreport(ResolutionCacheManager cache, String organisation, String module) {
// first process the report with xslt
XSLTProcess xslt = new XSLTProcess();
xslt.setTaskName(getTaskName());
xslt.setProject(getProject());
xslt.init();
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
xslt.setOut(new File(getTodir(), outputname + "." + xslext));
xslt.setStyle(xslFile);
XSLTProcess.Param xslExt = xslt.createParam();
xslExt.setName("extension");
xslExt.setExpression(xslext);
// add the provided XSLT parameters
for (XSLTProcess.Param param : params) {
XSLTProcess.Param realParam = xslt.createParam();
realParam.setName(param.getName());
realParam.setExpression(param.getExpression());
}
xslt.execute();
}
Aggregations