Package org.apache.xpath

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


            CachedXPathAPI xpathAPI = new CachedXPathAPI();

            Element nsctx = doc.createElement("nsctx");
            nsctx.setAttribute("xmlns:ds", Constants.SignatureSpecNS);

            Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                    "//ds:Signature", nsctx);

            // check to make sure that the document claims to have been signed
            if (signatureElem == null) {
                System.out.println("The document is not signed");
View Full Code Here


         // create the XPathFilterCHGPContainer so that we easily can read it out
         Element nscontext =
            XMLUtils.createDSctx(doc, "dsig-xpathalt",
                                 Transforms.TRANSFORM_XPATHFILTERCHGP);
         Element xpathElement =
            (Element) myXPathAPI
               .selectSingleNode(transformElement, "./dsig-xpathalt:"
                                 + XPathFilterCHGPContainer
                                    ._TAG_XPATHCHGP, nscontext);

         if (xpathElement == null) {
View Full Code Here

            CachedXPathAPI xpathAPI = new CachedXPathAPI();

            Element nsctx = doc.createElement("nsctx");
            nsctx.setAttribute("xmlns:ds", Constants.SignatureSpecNS);

            Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                    "//ds:Signature", nsctx);

            // check to make sure that the document claims to have been signed
            if (signatureElem == null) {
                System.out.println("The document is not signed");
View Full Code Here

    }

    public String getQuery(Node node) throws Exception {
        CachedXPathAPI xpath = new CachedXPathAPI();

        node = xpath.selectSingleNode(node, "sql/child::text()");

        // First child should be <sql></sql> element
        if (node == null) {
            throw new IllegalStateException("Expecting <sql></sql> node. Found: " + node);
        }
View Full Code Here

      Element nsctx = doc.createElementNS(null, "nsctx");

      nsctx.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:ds",
                           Constants.SignatureSpecNS);

      Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                                 "//ds:Signature", nsctx);
      XMLSignature sig = new XMLSignature(signatureElem, BaseURI);
      boolean verify = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());

      System.out.println("The signature is" + (verify
View Full Code Here

    }

    public String getQuery(Node node) throws Exception {
        CachedXPathAPI xpath = new CachedXPathAPI();

        node = xpath.selectSingleNode(node, "sql/child::text()");

        // First child should be <sql></sql> element
        if (node == null) {
            throw new IllegalStateException("Expecting <sql></sql> node. Found: " + node);
        }
View Full Code Here

                  .append(XML_ELEMENT_NAME)
                  .append("[@name='")
                  .append(propertySetName)
                  .append("']");
    try {
      Node propertySetNode = xpath.selectSingleNode(xmlMPSdom,xpathSB.toString());
      if (propertySetNode == null) {
        throw new PropertySetNotFoundException("Could not find a property-set for [" + propertySetName + "] in " + xmlConfiguration.getFilename());
      }
      ps = new PropertySet(propertySetName,(Element) propertySetNode);
      this.propertSets.put(propertySetName, ps);
View Full Code Here

      CachedXPathAPI xpathAPI = new CachedXPathAPI();
      Element nsctx = doc.createElement("nsctx");

      nsctx.setAttribute("xmlns:ds", Constants.SignatureSpecNS);

      Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                                 "//ds:Signature", nsctx);
      XMLSignature sig = new XMLSignature(signatureElem, BaseURI);
      boolean verify = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());

      System.out.println("The signature is" + (verify
View Full Code Here

            DOMSource inMessageXml = (DOMSource)sourceTransformer.toDOMSource(msg.getContent());

            // Parse out the actual message content
            CachedXPathAPI xpath = new CachedXPathAPI();
           
            Node exampleNode = xpath.selectSingleNode(inMessageXml.getNode(), "/example");
           
            if (exampleNode != null)
                {
                String value = exampleNode.getTextContent();
                propertySet.setString("ExampleKey", value);
View Full Code Here

                    .toDOMSource(msg.getContent());

            // Parse out the actual message content
            CachedXPathAPI xpath = new CachedXPathAPI();

            Node exampleNode = xpath.selectSingleNode(inMessageXml.getNode(),
                    "/example");

            if (exampleNode != null) {
                String value = exampleNode.getTextContent();
                logger.info("Received content: " + value);
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.