use of org.apache.synapse.util.jaxp.DOOMResultBuilderFactory in project wso2-synapse by wso2.
the class XSLTMediator method addFeature.
/**
* Add a feature to be set on the {@link TransformerFactory} used by this mediator instance.
* This method can also be used to enable some Synapse specific optimizations and
* enhancements as described in the documentation of this class.
*
* @param featureName The name of the feature
* @param isFeatureEnable the desired state of the feature
*
* @see TransformerFactory#setFeature(String, boolean)
* @see XSLTMediator
*/
public void addFeature(String featureName, boolean isFeatureEnable) {
MediatorProperty mp = new MediatorProperty();
mp.setName(featureName);
if (isFeatureEnable) {
mp.setValue("true");
} else {
mp.setValue("false");
}
transformerFactoryFeatures.add(mp);
if (USE_DOM_SOURCE_AND_RESULTS.equals(featureName)) {
if (isFeatureEnable) {
sourceBuilderFactory = new DOOMSourceBuilderFactory();
resultBuilderFactory = new DOOMResultBuilderFactory();
}
} else {
try {
transFact.setFeature(featureName, isFeatureEnable);
} catch (TransformerConfigurationException e) {
String msg = "Error occurred when setting features to the TransformerFactory";
log.error(msg, e);
throw new SynapseException(msg, e);
}
}
}
Aggregations