Java 8 XPathFilterParameterSpec - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 XPathFilterParameterSpec class.

This code example shows how to use the following methods:getXPath
 
    protected Node getOutputNodeViaXPath(Input input) throws Exception { //NOPMD
        checkSearchValueNotNull(input);
        checkSearchValueOfType(XPathFilterParameterSpec.class, input);
        XPathFilterParameterSpec xpathFilter = (XPathFilterParameterSpec) input.getOutputNodeSearch();
        XPathExpression expr = XmlSignatureHelper.getXPathExpression(xpathFilter);
        NodeList nodes = (NodeList) expr.evaluate(input.getMessageBodyDocument(), XPathConstants.NODESET);
        if (nodes == null || nodes.getLength() == 0) {
            throw new XmlSignatureException( 
                    String.format(
                            "Cannot extract root node for the output document from the XML signature document. No node found for XPATH %s as specified in the output node search.", 
                            xpathFilter.getXPath()));
        } 
        if (nodes.getLength() > 1) {
            throw new XmlSignatureException( 
                    String.format(
                            "Cannot extract root node for the output document from the XML signature document. XPATH %s as specified in the output node search results into more than one child.", 
                            xpathFilter.getXPath()));
 
        } 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 XPathFilterParameterSpec Methods: