use of org.apache.tools.ant.types.XMLCatalog 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.types.XMLCatalog in project ant by apache.
the class ApacheCatalogResolver method parseCatalog.
/**
* XMLCatalog calls this to add an external catalog file for each
* file within a <code><catalogfiles></code> fileset.
* @param file the external catalog file.
*/
public void parseCatalog(final String file) {
final Catalog catalog = getCatalog();
if (!(catalog instanceof ApacheCatalog)) {
throw new BuildException("Wrong catalog type found: %s", catalog.getClass().getName());
}
final ApacheCatalog apacheCatalog = (ApacheCatalog) catalog;
// Pass in reference to ourselves so we can be called back.
apacheCatalog.setResolver(this);
try {
apacheCatalog.parseCatalog(file);
} catch (IOException ex) {
throw new BuildException(ex);
}
}
Aggregations