26Configure the XML Reader

Configuration on Java

  • Feature ResolverFeature.XMLREADER_SUPPLIER (type: Supplier<XMLReader>)

Configuration on .NET

  • This setting has no equivalent on .NET

The default supplier is obtained with SAXParserFactory.newInstance() and the global mechanisms that it uses.

This feature and the SAXPARSERFACTORY_CLASS are different mechanisms for configuring the same underlying feature: how does the resolver get an XML parser if it needs one? (For example, for the ResolvingXMLFilter and ResolvingXMLReader classes.)

The SAXPARSERFACTORY_CLASS is initially null and the XMLREADER_SUPPLIER is used. The purpose of the SAXPARSERFACTORY_CLASS is to allow the factory to be configured with a property since the XMLREADER_SUPPLIER cannot.

If a SAXPARSERFACTORY_CLASS is specified, it will be used in favor of the default XMLREADER_SUPPLIER. If an XMLREADER_SUPPLIER is explicitly set after the configuration is initialized, it will set this feature to null and take precedence.