Examples of XPathContainer


Examples of org.apache.xml.security.transforms.params.XPathContainer

            c.setAttributeNS(null, "name", "val");
            ob1.appendChild(c);
            sig.appendObject(ob1);

            Transforms transforms = new Transforms(doc);
            XPathContainer xc = new XPathContainer(doc);
            xc.setXPathNamespaceContext("prof", Constants.SignatureSpecNS);

            String xpath = "\n"
                + "count(" + "\n"
                + " ancestor-or-self::prof:Object " + "\n"
                + " | " + "\n"
                + " here()/ancestor::prof:Signature[1]/child::prof:Object[@Id='object-1']" + "\n"
                + ") <= count(" + "\n"
                + " ancestor-or-self::prof:Object" + "\n"
                + ") " + "\n";

            xc.setXPath(xpath);
            HelperNodeList nl = new HelperNodeList();
            nl.appendChild(doc.createTextNode("\n"));
            nl.appendChild(xc.getElement());
            nl.appendChild(doc.createTextNode("\n"));

            transforms.addTransform(Transforms.TRANSFORM_XPATH, nl);
            transforms.addTransform(Transforms.TRANSFORM_C14N_WITH_COMMENTS);
            sig.addDocument("", transforms, Constants.ALGO_ID_DIGEST_SHA1);
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.