changeset 7967:6d5cbd69511a

Added dc:lowercase() dc:uppercase()
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 26 Jun 2014 12:44:40 +0200
parents d1cfd23e35cd
children 09c9920e6f24
files artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Wed Jun 25 15:40:44 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Thu Jun 26 12:44:40 2014 +0200
@@ -86,6 +86,20 @@
 
         functions = new HashMap<String, Entry>();
 
+        addFunction("lowercase", 1, new XPathFunction() {
+            @Override
+            public Object evaluate(List args) throws XPathFunctionException {
+                return args.get(0).toString().toLowerCase();
+            }
+        });
+
+        addFunction("uppercase", 1, new XPathFunction() {
+            @Override
+            public Object evaluate(List args) throws XPathFunctionException {
+                return args.get(0).toString().toUpperCase();
+            }
+        });
+
         addFunction("contains", 2, new XPathFunction() {
             @Override
             public Object evaluate(List args) throws XPathFunctionException {

http://dive4elements.wald.intevation.org