Package javax.xml.xpath

Examples of javax.xml.xpath.XPathFactory.newXPath()


            }
        }
        if (xpaths != null && !xpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : xpaths) {
                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
                try {
                    NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
View Full Code Here


            }
        }
        if (contentXpaths != null && !contentXpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : contentXpaths) {
                XPath xpath = factory.newXPath();
                if (cnamespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(cnamespaces));
                }
                try {
                    NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
View Full Code Here

                    xpaths = p.getXPathExpressions();
                }
                if (xpaths != null) {
                    XPathFactory factory = XPathFactory.newInstance();
                    for (String expression : xpaths) {
                        XPath xpath = factory.newXPath();
                        if (namespaces != null) {
                            xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                        }
                        try {
                            NodeList list = (NodeList)xpath.evaluate(expression,
View Full Code Here

                RequiredElements rp = (RequiredElements)ai.getAssertion();
                ai.setAsserted(true);
                Map<String, String> namespaces = rp.getDeclaredNamespaces();
                XPathFactory factory = XPathFactory.newInstance();
                for (String expression : rp.getXPathExpressions()) {
                    XPath xpath = factory.newXPath();
                    if (namespaces != null) {
                        xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                    }
                    NodeList list;
                    try {
View Full Code Here

        return docBuilderFactory.newDocumentBuilder();
    }

    private void parseDocument(Document doc) throws Exception {
        XPathFactory xPathFactory = XPathFactory.newInstance();
        XPath xPath = xPathFactory.newXPath();
        // Use a bunch of incremental XPath expressions rather than one big XPath expression,
        // so we can provide better log messages.
        Node invokerMBeanNode = (Node)xPath.evaluate("//server/mbean[@name = 'jboss.jmx:type=adaptor,name=Invoker']",
                    doc, XPathConstants.NODE);
        if (invokerMBeanNode == null) {
View Full Code Here

                noTime);
        // assert that we have a timestamp and datetime
        // can't rely on the datetime being the same due to timezone differences
        // instead, we'll assert that the values exist.
        XPathFactory xpf = XPathFactory.newInstance();
        XPath xp = xpf.newXPath();
        xp.setNamespaceContext(new NamespaceContext() {
            public String getNamespaceURI(String aArg0) {
                return "urn:org.apache.camel.component:jmx";
            }
            public String getPrefix(String aArg0) {
View Full Code Here

    }

    // Now the XPath expression
    try {
      XPathFactory xpathFact = XPathFactory.newInstance();
      XPath xpath = xpathFact.newXPath();
      Boolean result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);

      /*
       * Set control port to make execution flow continue according to
       * condition
 
View Full Code Here

    };

    // Now the XPath expression
    String xpathStr = "/tg:Kit.Services/Service/Endpoint/text()";
    XPathFactory xpathFact = XPathFactory.newInstance();
    XPath xpath = xpathFact.newXPath();
    xpath.setNamespaceContext(ctx);

    try {
      Object endPoint;
View Full Code Here

    try {
      builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();

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

      domainrelXpath = xpath.compile("//*[@class='domain-rel']");
      semrelXpath = xpath.compile("//*[@class='sem-rel']");
      semclassXpath = xpath.compile("//*[@class='sem-class']");

 
View Full Code Here

        List<WSEncryptionPart> result = new ArrayList<WSEncryptionPart>();
       
        if (xpaths != null && !xpaths.isEmpty()) {
            XPathFactory factory = XPathFactory.newInstance();
            for (String expression : xpaths) {
                XPath xpath = factory.newXPath();
                if (namespaces != null) {
                    xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
                }
              
                NodeList list = (NodeList)xpath.evaluate(expression, saaj.getSOAPPart().getEnvelope(),
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.