title: TransformerFactory and Xalan Dependency Conflict
body: <p>I have the following code:</p>
  
  <pre><code>javax.xml.transform.TransformerFactory factory = TransformerFactory.newInstance();
  factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
  javax.xml.transform.Transformer transformer = factory.newTransformer();
  </code></pre>
  
  <p>This works fine normally. However, I also need to add Xalan as a dependency in my pom.xml, and when I do, the above code now throws an error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Not supported: http://javax.xml.XMLConstants/property/accessExternalDTD
  </code></pre>
  
  <p>I think it has something to do with the fact that Xalan's jar has a different implementation of Transformer in it. How can I resolve this conflict without changing the above code and keeping Xalan as a dependency?</p>