Skip to content

Commit

Permalink
supress ns check in TransformerWapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Arrow committed Apr 7, 2016
1 parent b40c89a commit c8babb4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/org/xmlcml/norma/util/TransformerWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import net.sf.saxon.TransformerFactoryImpl;
import net.sf.saxon.Configuration;
import net.sf.saxon.lib.FeatureKeys;
import nu.xom.Document;
import nu.xom.Element;

Expand Down Expand Up @@ -61,9 +64,9 @@ public Transformer createTransformer(File stylesheet) throws Exception {
}

public Transformer createTransformer(org.w3c.dom.Document xslStylesheet) throws Exception {
System.setProperty(JAVAX_XML_TRANSFORM_TRANSFORMER_FACTORY,
NET_SF_SAXON_TRANSFORMER_FACTORY_IMPL);
TransformerFactory tfactory = TransformerFactory.newInstance();
Configuration config = new Configuration();
config.setConfigurationProperty(FeatureKeys.SUPPRESS_XSLT_NAMESPACE_CHECK, "true");
TransformerFactory tfactory = new TransformerFactoryImpl(config);
DOMSource domSource = new DOMSource(xslStylesheet);
javaxTransformer = tfactory.newTransformer(domSource);
return javaxTransformer;
Expand Down

0 comments on commit c8babb4

Please sign in to comment.