Package javax.xml.xpath

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


          return datatypes.put(name, plugin);
        }
      };

      final String expression = "/datatypeConfig/datatype";
      final NodeList nodes = (NodeList) xpath.evaluate(expression, document, XPathConstants.NODESET);
      datatypeLoader.load(loader, nodes);
    }
    catch (final SolrException e) {
      throw e;
    }
View Full Code Here


                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
              
                NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
                                               XPathConstants.NODESET);
                for (int x = 0; x < list.getLength(); x++) {
                    Element el = (Element)list.item(x);
                   
                    if (!found.contains(el)) {
View Full Code Here

                    if (namespaces != null) {
                        xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                    }
                    NodeList list;
                    try {
                        list = (NodeList)xpath.evaluate(expression,
                                                                 header,
                                                                 XPathConstants.NODESET);
                        if (list.getLength() == 0) {
                            ai.setNotAsserted("No header element matching XPath " + expression + " found.");
                        }
View Full Code Here

        // For each XPath
        for (String xpathString : xPaths) {
            // Get the matching nodes
            NodeList list;
            try {
                list = (NodeList)xpath.evaluate(
                        xpathString,
                        message.getSOAPPart().getEnvelope(),
                        XPathConstants.NODESET);
            } catch (XPathExpressionException e) {
                // The xpath's are not valid in the config.
View Full Code Here

      DocumentBuilder builder = domFactory.newDocumentBuilder();
      StringReader reader = new StringReader(error);
      Document doc = builder.parse(new InputSource(reader));
      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();
      String method = (String) xpath
        .evaluate("/Error/@Method", doc, XPathConstants.STRING);
      String calaisRequestID = (String) xpath
        .evaluate("/Error/@calaisRequestID", doc, XPathConstants.STRING);
      String creationDate = (String) xpath
        .evaluate("/Error/@CreationDate", doc, XPathConstants.STRING);
View Full Code Here

      Document doc = builder.parse(new InputSource(reader));
      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();
      String method = (String) xpath
        .evaluate("/Error/@Method", doc, XPathConstants.STRING);
      String calaisRequestID = (String) xpath
        .evaluate("/Error/@calaisRequestID", doc, XPathConstants.STRING);
      String creationDate = (String) xpath
        .evaluate("/Error/@CreationDate", doc, XPathConstants.STRING);
      String calaisVersion = (String) xpath
        .evaluate("/Error/@CalaisVersion", doc, XPathConstants.STRING);
View Full Code Here

      XPath xpath = factory.newXPath();
      String method = (String) xpath
        .evaluate("/Error/@Method", doc, XPathConstants.STRING);
      String calaisRequestID = (String) xpath
        .evaluate("/Error/@calaisRequestID", doc, XPathConstants.STRING);
      String creationDate = (String) xpath
        .evaluate("/Error/@CreationDate", doc, XPathConstants.STRING);
      String calaisVersion = (String) xpath
        .evaluate("/Error/@CalaisVersion", doc, XPathConstants.STRING);
      String exception = (String) xpath
        .evaluate("/Error/Exception/text()", doc, XPathConstants.STRING);
View Full Code Here

        .evaluate("/Error/@Method", doc, XPathConstants.STRING);
      String calaisRequestID = (String) xpath
        .evaluate("/Error/@calaisRequestID", doc, XPathConstants.STRING);
      String creationDate = (String) xpath
        .evaluate("/Error/@CreationDate", doc, XPathConstants.STRING);
      String calaisVersion = (String) xpath
        .evaluate("/Error/@CalaisVersion", doc, XPathConstants.STRING);
      String exception = (String) xpath
        .evaluate("/Error/Exception/text()", doc, XPathConstants.STRING);
      return new CalaisException(method, calaisRequestID, creationDate,
                                 calaisVersion, exception);
View Full Code Here

        .evaluate("/Error/@calaisRequestID", doc, XPathConstants.STRING);
      String creationDate = (String) xpath
        .evaluate("/Error/@CreationDate", doc, XPathConstants.STRING);
      String calaisVersion = (String) xpath
        .evaluate("/Error/@CalaisVersion", doc, XPathConstants.STRING);
      String exception = (String) xpath
        .evaluate("/Error/Exception/text()", doc, XPathConstants.STRING);
      return new CalaisException(method, calaisRequestID, creationDate,
                                 calaisVersion, exception);
    } catch (Exception e) {
      throw new RuntimeException("Unable to parse exception", e);
View Full Code Here

            DocumentBuilder builder = domFactory.newDocumentBuilder();
            Document doc = builder.parse(procDefIS);

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

            NodeList nodeList = (NodeList) xpath.evaluate("//userTask | //serviceTask | //scriptTask", doc,
                    XPathConstants.NODESET);
            for (int i = 0; i < nodeList.getLength(); i++) {
                result.add(nodeList.item(i).getAttributes().getNamedItem("id").getNodeValue());
            }
        } catch (Exception e) {
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.