public static XMLReader createXMLReader () throws SAXException

Obtains a new instance of a org.xml.sax.XMLReader. This method uses the following ordered lookup procedure to find and load the org.xml.sax.XMLReader implementation class:

  1. If the system property org.xml.sax.driver has a value, that is used as an XMLReader class name.
  2. Use the service-provider loading facility, defined by the java.util.ServiceLoader class, to attempt to locate and load an implementation of the service org.xml.sax.XMLReader by using the current thread's context class loader. If the context class loader is null, the system class loader will be used.
  3. Deprecated. Look for a class name in the META-INF/services/org.xml.sax.driver file in a jar file available to the runtime.
  4. Otherwise, the system-default implementation is returned.

Returns:  a new XMLReader.

Exceptions:
org.xml.sax.SAXException    If no default XMLReader class can be identified and instantiated.

See also:
createXMLReader(java.lang.String)

@apiNote The process that looks for a class name in the META-INF/services/org.xml.sax.driver file in a jar file does not conform to the specification of the service-provider loading facility as defined in java.util.ServiceLoader and therefore does not support modularization. It is deprecated as of Java SE 9 and subject to removal in a future release.