Spring Framework SimpleNamespaceContext - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SimpleNamespaceContext class.

This code example shows how to use the following methods:setBindings
	} 
 
	private XPathExpression compileXpathExpression(String expression, Map<String, String> namespaces) 
			throws XPathExpressionException { 
 
		SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); 
		namespaceContext.setBindings((namespaces != null) ? namespaces : Collections.<String, String> emptyMap()); 
		XPath xpath = XPathFactory.newInstance().newXPath(); 
		xpath.setNamespaceContext(namespaceContext); 
		return xpath.compile(expression); 
	} 
 
	/** 
	 * @return the compiled XPath expression. 
	 */ 
	protected XPathExpression getXpathExpression() { 
		return this.xpathExpression; 
	} 
 
	/** 
7
CodeRank
This code example shows how to use the following methods:setBindings
This code example shows how to use the following methods:bindNamespaceUri
            new ReferencedEnvelope(-180,180,-90,90, DefaultGeographicCRS.WGS84)); 
        return mapContent;
    } 
 
    void initXPath(XPath xpath) {
        SimpleNamespaceContext ctx = new SimpleNamespaceContext();
        ctx.bindNamespaceUri("kml", "http://www.opengis.net/kml/2.2");
        xpath.setNamespaceContext(ctx);
    } 
 
    /** 
     * Creates a key/value pair map from the cgi parameters in the provided url 
     *  
     * @param url an url where all the cgi parameter values are url encoded 
     * @return a map with the key value pairs from the url with all the parameter names in upper 
     *         case 
     */ 
    static Map<String, String> toKvp(String url) {
        if (url.indexOf('?') > 0) {
            url = url.substring(url.indexOf('?') + 1);
3
CodeRank
See Code Examples for Spring Framework SimpleNamespaceContext Methods: