Search in sources :

Example 1 with PrefixResolver

use of com.sun.org.apache.xml.internal.utils.PrefixResolver in project jdk8u_jdk by JetBrains.

the class XalanXPathAPI method createXPath.

private XPath createXPath(String str, PrefixResolver prefixResolver) throws TransformerException {
    XPath xpath = null;
    Class<?>[] classes = new Class<?>[] { String.class, SourceLocator.class, PrefixResolver.class, int.class, ErrorListener.class, FunctionTable.class };
    Object[] objects = new Object[] { str, null, prefixResolver, Integer.valueOf(XPath.SELECT), null, funcTable };
    try {
        Constructor<?> constructor = XPath.class.getConstructor(classes);
        xpath = (XPath) constructor.newInstance(objects);
    } catch (Exception ex) {
        if (log.isLoggable(java.util.logging.Level.FINE)) {
            log.log(java.util.logging.Level.FINE, ex.getMessage(), ex);
        }
    }
    if (xpath == null) {
        xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
    }
    return xpath;
}
Also used : XPath(com.sun.org.apache.xpath.internal.XPath) ErrorListener(javax.xml.transform.ErrorListener) FunctionTable(com.sun.org.apache.xpath.internal.compiler.FunctionTable) SourceLocator(javax.xml.transform.SourceLocator) PrefixResolver(com.sun.org.apache.xml.internal.utils.PrefixResolver) XObject(com.sun.org.apache.xpath.internal.objects.XObject) TransformerException(javax.xml.transform.TransformerException)

Aggregations

PrefixResolver (com.sun.org.apache.xml.internal.utils.PrefixResolver)1 XPath (com.sun.org.apache.xpath.internal.XPath)1 FunctionTable (com.sun.org.apache.xpath.internal.compiler.FunctionTable)1 XObject (com.sun.org.apache.xpath.internal.objects.XObject)1 ErrorListener (javax.xml.transform.ErrorListener)1 SourceLocator (javax.xml.transform.SourceLocator)1 TransformerException (javax.xml.transform.TransformerException)1