1 28 29 package com.caucho.xsl.fun; 30 31 import com.caucho.xpath.Expr; 32 import com.caucho.xpath.ExprEnvironment; 33 import com.caucho.xpath.XPathException; 34 import com.caucho.xpath.XPathFun; 35 import com.caucho.xpath.pattern.AbstractPattern; 36 37 import org.w3c.dom.Node ; 38 39 import java.util.ArrayList ; 40 41 44 public class SystemPropertyFun extends XPathFun { 45 51 public Object eval(Node node, ExprEnvironment env, 52 AbstractPattern pattern, ArrayList args) 53 throws XPathException 54 { 55 if (args.size() < 1) 56 return ""; 57 58 String name = Expr.toString(args.get(0)); 59 60 if (name.equals("xsl:version")) 61 return new Double (1.0); 62 else if (name.equals("xsl:vendor")) 63 return "Caucho Technology"; 64 else if (name.equals("xsl:vendor-url")) 65 return "http://www.caucho.com"; 66 else 67 return System.getProperty(name); 68 } 69 } 70 | Popular Tags |