Package org.apache.xpath

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


            nl = xpathAPI.selectNodeList(doc, (String) xpath);
         } else {
            Element xpathElement = (Element) xpath;
            String xpathStr = ((Text) xpathElement.getFirstChild()).getData();

            nl = xpathAPI.selectNodeList(doc, xpathStr, xpathElement);
         }

         c14nBytes = c14n.canonicalizeXPathNodeSet(nl);
      }
View Full Code Here


      Canonicalizer c14nizer =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      CachedXPathAPI xpathAPI = new CachedXPathAPI();
      XMLUtils.circumventBug2650(doc);
      NodeList nodes =
         xpathAPI.selectNodeList(doc, "(//*[local-name()='included'] | //@*)");
      byte result[] = c14nizer.canonicalizeXPathNodeSet(nodes);
      byte defined[] = definedOutput.getBytes();

      if (writeResultsToFile) {
         File fileD = new File("defined.txt");
View Full Code Here

            int currentRootNodeType = currentRootNode.getNodeType();

            if ((currentRootNodeType == Node.ELEMENT_NODE)
                    || (currentRootNodeType == Node.DOCUMENT_NODE)) {
               NodeList nodesInSubtree =
                  myXPathAPI
                     .selectNodeList(currentRootNode, Canonicalizer
                        .XPATH_C14N_WITH_COMMENTS_SINGLE_NODE);
               int jMax = nodesInSubtree.getLength();

               for (int j = 0; j < jMax; j++) {
View Full Code Here

         nsctx.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:x",
                            ApacheKeyStoreConstants.ApacheKeyStore_NAMESPACE);

         NodeList aliasNodes =
            xpath.selectNodeList(this._doc,
                                 "/x:" + ApacheKeyStoreConstants._TAG_KEYSTORE
                                 + "/x:*/x:"
                                 + ApacheKeyStoreConstants._TAG_ALIAS
                                 + "/text()", nsctx);
         Vector result = new Vector(aliasNodes.getLength());
View Full Code Here

         String searchExpr = "/x:" + ApacheKeyStoreConstants._TAG_KEYSTORE
                             + "/x:" + ApacheKeyStoreConstants._TAG_CERTIFICATE
                             + "[./x:" + ApacheKeyStoreConstants._TAG_ALIAS
                             + "/text()=\"" + alias + "\"]";
         NodeList aliasNodes = xpath.selectNodeList(this._doc, searchExpr,
                                                    nsctx);

         if (aliasNodes.getLength() == 1) {
            return (Element) aliasNodes.item(0);
         }
View Full Code Here

         String searchExpr = "/x:" + ApacheKeyStoreConstants._TAG_KEYSTORE
                             + "/x:" + ApacheKeyStoreConstants._TAG_KEY
                             + "[./x:" + ApacheKeyStoreConstants._TAG_ALIAS
                             + "/text()=\"" + alias + "\"]";
         NodeList aliasNodes = xpath.selectNodeList(this._doc, searchExpr,
                                                    nsctx);

         if (aliasNodes.getLength() == 1) {
            return (Element) aliasNodes.item(0);
         }
View Full Code Here

      CachedXPathAPI cXPathAPI = new CachedXPathAPI();

      try {
         if (isXPointerSlash(uri, BaseURI)) {
            resultNodes =
               cXPathAPI.selectNodeList(doc,
                                        Canonicalizer.XPATH_C14N_WITH_COMMENTS);
         } else if (isXPointerId(uri, BaseURI)) {
            String id = getXPointerId(uri, BaseURI);
            Element selectedElem = IdResolver.getElementById(doc, id);
View Full Code Here

               throw new ResourceResolverException(
                  "signature.Verification.MissingID", exArgs, uri, BaseURI);
            }

            resultNodes =
               cXPathAPI
                  .selectNodeList(selectedElem, Canonicalizer
                     .XPATH_C14N_WITH_COMMENTS_SINGLE_NODE);
         }
      } catch (javax.xml.transform.TransformerException ex) {
         throw new ResourceResolverException("generic.EmptyMessage", ex, uri,
View Full Code Here

          */

         // cat.debug("ResolverFragment with empty URI (means complete document)");
         try {
            resultNodes =
               cXPathAPI.selectNodeList(doc,
                                        Canonicalizer.XPATH_C14N_OMIT_COMMENTS);
         } catch (javax.xml.transform.TransformerException ex) {
            throw new ResourceResolverException("generic.EmptyMessage", ex,
                                                uri, BaseURI);
         }
View Full Code Here

         if (selectedElem == null) {
            resultNodes = new HelperNodeList();
         } else {
            try {
               resultNodes =
                  cXPathAPI
                     .selectNodeList(selectedElem, Canonicalizer
                        .XPATH_C14N_OMIT_COMMENTS_SINGLE_NODE);
            } catch (javax.xml.transform.TransformerException ex) {
               throw new ResourceResolverException("generic.EmptyMessage", ex,
                                                   uri, BaseURI);
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.