Examples of newXPath()


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

        CryptoCoverageUtil.reconcileEncryptedSignedRefs(signed, encrypted);

        // XPathFactory and XPath are not thread-safe so we must recreate them
        // each request.
        final XPathFactory factory = XPathFactory.newInstance();
        final XPath xpath = factory.newXPath();

        if (this.prefixMap != null) {
            xpath.setNamespaceContext(new MapNamespaceContext(this.prefixMap));
        }
View Full Code Here

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

        final String expectedSignatureMethod = binding.getAlgorithmSuite().getAsymmetricSignature();
        final String expectedDigestAlgorithm = binding.getAlgorithmSuite().getDigest();
        final String expectedCanonAlgorithm  = binding.getAlgorithmSuite().getInclusiveC14n();
           
        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        final NamespaceContext nsContext = this.getNamespaceContext();
        xpath.setNamespaceContext(nsContext);
       
        // Signature Algorithm
        final XPathExpression sigAlgoExpr =
View Full Code Here

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

   
    // TODO: This method can be removed when runOutInterceptorAndValidateSamlTokenAttached
    // is cleaned up.
    protected void verifySignatureCoversAssertion(Document signedDoc, String assertionId) throws Exception {
        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        final NamespaceContext nsContext = this.getNamespaceContext();
        xpath.setNamespaceContext(nsContext);
       
        // Find the SecurityTokenReference for the assertion
        final XPathExpression strExpr = xpath.compile(
View Full Code Here

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

     * @throws java.lang.Exception
     */
    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        XPathFactory factory = XPathFactory.newInstance();
        xpath = factory.newXPath();
        xpath.setNamespaceContext(new NamespaceContextImpl());
        xpath.setXPathFunctionResolver(new PolicyXPathFunctionResolver(xpath.getNamespaceContext()));
    }

    @Test
View Full Code Here

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

    private final NamespaceContext parent;

    public DefaultNamespaceContext() {
        this.map = new HashMap();
        XPathFactory factory = XPathFactory.newInstance();
        this.parent = factory.newXPath().getNamespaceContext();
    }

    public DefaultNamespaceContext(NamespaceContext parent, Map map) {
        this.parent = parent;
        this.map = map;
View Full Code Here

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

    ) throws Exception {
        XMLCipher cipher = XMLCipher.getInstance(algorithm);
        cipher.init(XMLCipher.ENCRYPT_MODE, encryptingKey);

        XPathFactory xpf = XPathFactory.newInstance();
        XPath xpath = xpf.newXPath();
        xpath.setNamespaceContext(new DSNamespaceContext());

        EncryptedData builder = cipher.getEncryptedData();
        KeyInfo builderKeyInfo = builder.getKeyInfo();
        if (builderKeyInfo == null) {
View Full Code Here

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

                    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

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

                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

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

      dBuilder = dbFactory.newDocumentBuilder();
      Document doc = dBuilder.parse(new File(projectFolder, ".project"));
      doc.getDocumentElement().normalize();
     
      XPathFactory xFactory = XPathFactory.newInstance();
      XPath xpath = xFactory.newXPath();
      XPathExpression expr = xpath.compile("/projectDescription/name/text()");
     
      return (String) expr.evaluate(doc, XPathConstants.STRING);
     
    } catch (Exception e) {
View Full Code Here

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

  private Object evaluateXpath(String xpathExpression, QName returnType) {
    Object result = "";
    try {
      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();

      xpath.setNamespaceContext(new OlefNamespaceContext());

      XPathExpression expr = xpath.compile(xpathExpression);
      Object obj = expr.evaluate(doc, returnType);
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.