title: StAX - how to set XMLInputFactory.IS_VALIDATING to true?
body: <p>this is my first time using StAX for parsing XML documents (still in the learning stage).  During the process to parse an XML document using XMLStreamReader and generate a copy of the document using XMLStreamWriter, I encountered the following warning represented as a comment in the output of the writer:</p>
  
  <pre><code> &lt;!-- Exception scanning External DTD Subset.  True contents of DTD cannot be determined.  Processing will continue as XMLInputFactory.IS_VALIDATING == false. --&gt;
  </code></pre>
  
  <p>I understood the cause of the warning, but I wanted it to become an error rather than silently became a warning, so then I tried to set XMLInputFactory.IS_VALIDATING to true:</p>
  
  <pre><code> XMLInputFactory factory = XMLInputFactory.newInstance();
   factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.TRUE);
  </code></pre>
  
  <p>But the above threw an exception for me:</p>
  
  <blockquote>
    <p>Exception in thread "main"
    java.lang.IllegalArgumentException:
    true value of isValidating not
    supported     at
    com.sun.org.apache.xerces.internal.impl.PropertyManager.setProperty(PropertyManager.java:150)
      at
    com.sun.xml.internal.stream.XMLInputFactoryImpl.setProperty(XMLInputFactoryImpl.java:257)
      at
    com.test.test2.helper.SgmlDocumentParser.parse(SgmlDocumentParser.java:83)
      at
    com.test.test2.helper.Test.main(Test.java:66)</p>
  </blockquote>
  
  <p>So what is wrong with my approach?</p>
  
  <p>Thanks!</p>