Add custom spring securtiy expression method

There are no offcial ways to add custom security expression, like hasRole / hasAuthority etc, the only way is to do some tweaking.
 
Solution 1. Create a static method and invoke by spel. Like below:
 
                <security:authorize access="T(com.Class).doSomething(request.parameterMap['parameterName'], 'ROLE_ADMIN')">

python, xpath and ElementTree

Failed to find a xpath solution in python2.6 standard library. Seems like ElementTree is the only API have limited xpath support. But...
 
http://effbot.org/zone/element-xpath.htm
http://codespeak.net/pipermail/lxml-dev/2006-May/001294.html
And for my test code:

deps = tree.findall("//dependency[@testP='testV']")
print deps

 
Error:

SyntaxError: expected path separator ([)
 
Also Find:

Pages