title: Difference SAXParserFactory and DocumentBuilderFactory
body: <p>What is the difference between SAXParserFactory and DocumentBuilderFactory. And which one to use when?</p>
  
  <p>Respectively: </p>
  
  <p><strong>javax.xml.parsers.SAXParserFactory</strong></p>
  
  <p>Selects the SAX parser. By default, org.apache.xerces.jaxp.SAXParserFactoryImpl from the XML4J library is used.</p>
  
  <p><strong>javax.xml.parsers.DocumentBuilderFactory</strong></p>
  
  <p>Selects the document builder. By default, org.apache.xerces.jaxp.DocumentBuilderFactoryImpl from the XML4J library is used.</p>