1 61 62 63 package org.jaxen.function.xslt; 64 65 import java.util.List ; 66 67 import org.jaxen.Context; 68 import org.jaxen.Function; 69 import org.jaxen.FunctionCallException; 70 import org.jaxen.Navigator; 71 import org.jaxen.function.StringFunction; 72 73 78 public class DocumentFunction implements Function 79 { 80 81 public Object call(Context context, 82 List args) throws FunctionCallException 83 { 84 if (args.size() == 1) 85 { 86 Navigator nav = context.getNavigator(); 87 88 String url = StringFunction.evaluate( args.get( 0 ), 89 nav ); 90 91 return evaluate( url, 92 nav ); 93 } 94 95 throw new FunctionCallException( "document() requires one argument." ); 96 } 97 98 public static Object evaluate(String url, 99 Navigator nav) throws FunctionCallException 100 { 101 return nav.getDocument( url ); 102 } 103 } 104 | Popular Tags |