Package org.apache.xpath

Examples of org.apache.xpath.CachedXPathAPI.eval()


            //eval() is a better way to determine the boolean value of the exp.
            //For compliance with legacy behavior where selecting an empty node returns true,
            //selectNodeIterator is attempted in case of a failure.

            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here


            //eval() is a better way to determine the boolean value of the exp.
            //For compliance with legacy behavior where selecting an empty node returns true,
            //selectNodeIterator is attempted in case of a failure.

            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here

        }
    }
    
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        XObject list = cachedXPathAPI.eval(node, xpath, new PrefixResolver() {
            public String getNamespaceForPrefix(String prefix) {
                if ("jbi".equals(prefix)) {
                    return "http://java.sun.com/xml/ns/jbi/management-message";
                }
                return null;
View Full Code Here

    String resultValue = null;
    if (msg.getContent() != null) {
      CachedXPathAPI xpathApi = new CachedXPathAPI();
      try {
        Document doc = new SourceTransformer().toDOMDocument(msg);
        XObject result = xpathApi.eval(doc,xpath);

        resultValue = result.toString();
        if ("".equals(resultValue)) {
          resultValue = null;
        }
View Full Code Here

      String propertySetName = "";
      if (xpathForPropertySet != null) {
        try {
          CachedXPathAPI xpathApi = new org.apache.xpath.CachedXPathAPI();
          Document doc = new SourceTransformer().toDOMDocument(in);
          XObject propSetXO = xpathApi.eval(doc.getDocumentElement(),xpathForPropertySet);
          propertySetName = propSetXO.str();
        } catch (Exception e) {
          throw new MessagingException("Problem getting the propertySet using XPath", e);
        }
      } else if (this.propertySet != null) {
View Full Code Here

            factory.setNamespaceAware(true);
            DocumentBuilder dbuilder = factory.newDocumentBuilder();
            Document doc = dbuilder.parse(inputSource);
           
            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here

            //eval() is a better way to determine the boolean value of the exp.
            //For compliance with legacy behavior where selecting an empty node returns true,
            //selectNodeIterator is attempted in case of a failure.
           
            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here

            factory.setNamespaceAware(true);
            DocumentBuilder dbuilder = factory.newDocumentBuilder();
            Document doc = dbuilder.parse(inputSource);
           
            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here

            //eval() is a better way to determine the boolean value of the exp.
            //For compliance with legacy behavior where selecting an empty node returns true,
            //selectNodeIterator is attempted in case of a failure.
           
            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
View Full Code Here

            factory.setNamespaceAware(true);
            DocumentBuilder dbuilder = factory.newDocumentBuilder();
            Document doc = dbuilder.parse(inputSource);
           
            CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
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.