Obtain a new instance of a XPathFactory
from a factory class name. XPathFactory
is returned if specified factory class supports the specified object model.
This function is useful when there are multiple providers in the classpath.
It gives more control to the application as it can specify which provider
should be loaded.
Tip for Trouble-shooting
Setting the jaxp.debug
system property will cause
this method to print a lot of debug messages
to System.err
about what it is doing and where it is looking at.
If you have problems try:
java -Djaxp.debug=1 YourProgram ....
Returns:
New instance of a
XPathFactory
Parameters:
-
uri - Identifies the underlying object model. The specification only defines the URI
{@link #DEFAULT_OBJECT_MODEL_URI},
http://java.sun.com/jaxp/xpath/dom
for the W3C DOM, the org.w3c.dom package, and implementations are free to introduce
other URIs for other object models.
-
factoryClassName - fully qualified factory class name that provides implementation of
javax.xml.xpath.XPathFactory
.
-
classLoader -
ClassLoader
used to load the factory class. If
null
current
Thread
's context classLoader is used to load the factory class.
Throws:
-
XPathFactoryConfigurationException - if
factoryClassName
is
null
, or
the factory class cannot be loaded, instantiated
or the factory class does not support the object model specified
in the
uri
parameter.
-
NullPointerException - If
uri
is
null
.
-
IllegalArgumentException - If
uri
is
null
or
uri.length() == 0
.
Since:
1.6
See Also:
XPathFactory.newInstance()
,
XPathFactory.newInstance(String uri)
,