Package javax.xml.xpath

Examples of javax.xml.xpath.XPath.compile()


        XPathFunctionResolver parentResolver = getFunctionResolver();
        if (parentResolver == null) {
            parentResolver = xPath.getXPathFunctionResolver();
        }
        xPath.setXPathFunctionResolver(createDefaultFunctionResolver(parentResolver));
        return xPath.compile(text);
    }

    protected synchronized XPathExpression createTraceNamespaceExpression() throws XPathFactoryConfigurationException, XPathExpressionException {
        // XPathFactory is not thread safe
        XPath xPath = getXPathFactory().newXPath();
View Full Code Here


    }

    protected synchronized XPathExpression createTraceNamespaceExpression() throws XPathFactoryConfigurationException, XPathExpressionException {
        // XPathFactory is not thread safe
        XPath xPath = getXPathFactory().newXPath();
        return xPath.compile(OBTAIN_ALL_NS_XPATH);
    }

    /**
     * Populate a number of standard prefixes if they are not already there
     */
 
View Full Code Here

                xpathObject.setXPathFunctionResolver(functionResolver);
            }
            if (namespaceContext != null) {
                xpathObject.setNamespaceContext(namespaceContext);
            }
            xPathExpression = xpathObject.compile(xpath);
        }
    }

    /**
     * Before evaluating the xpath expression, it will be compiled by calling
View Full Code Here

        XPathFunctionResolver parentResolver = getFunctionResolver();
        if (parentResolver == null) {
            parentResolver = xPath.getXPathFunctionResolver();
        }
        xPath.setXPathFunctionResolver(createDefaultFunctionResolver(parentResolver));
        return xPath.compile(text);
    }

    protected synchronized XPathExpression createTraceNamespaceExpression() throws XPathFactoryConfigurationException, XPathExpressionException {
        // XPathFactory is not thread safe
        XPath xPath = getXPathFactory().newXPath();
View Full Code Here

    }

    protected synchronized XPathExpression createTraceNamespaceExpression() throws XPathFactoryConfigurationException, XPathExpressionException {
        // XPathFactory is not thread safe
        XPath xPath = getXPathFactory().newXPath();
        return xPath.compile(OBTAIN_ALL_NS_XPATH);
    }

    /**
     * Populate a number of standard prefixes if they are not already there
     */
 
View Full Code Here

      Document doc = dBuilder.parse(new File(projectFolder, ".project"));
      doc.getDocumentElement().normalize();
     
      XPathFactory xFactory = XPathFactory.newInstance();
      XPath xpath = xFactory.newXPath();
      XPathExpression expr = xpath.compile("/projectDescription/name/text()");
     
      return (String) expr.evaluate(doc, XPathConstants.STRING);
     
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();

      xpath.setNamespaceContext(new OlefNamespaceContext());

      XPathExpression expr = xpath.compile(xpathExpression);
      Object obj = expr.evaluate(doc, returnType);
      result = obj;
    } catch (XPathExpressionException e) {
      e.printStackTrace();
    }
View Full Code Here

      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();

      xpath.setNamespaceContext(new MyNamespaceContext());

      XPathExpression expr = xpath.compile(xpathExpression);
      Object obj = expr.evaluate(doc, returnType);
      result = obj;
    } catch (XPathExpressionException e) {
      e.printStackTrace();
    }
View Full Code Here

                    public Iterator<String> getPrefixes(String namespaceURI) {
                        return null;
                    }
                }
        );
        return xPath.compile(expression);
    }

    class CustomWSS4JHandler extends WSHandler {

        private final org.slf4j.Logger log =
View Full Code Here

   * @throws XPathExpressionException
   */
  public static NodeIterator queryXPath(Node root, String query) throws XPathExpressionException {
    if (root == null || query == null) return new NodeIterator(null);
    XPath xpath = XPathFactory.newInstance().newXPath();
    XPathExpression expr = xpath.compile(query);
    NodeList result = (NodeList)expr.evaluate(root, XPathConstants.NODESET);
    return new NodeIterator(result);
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.