Index: DefaultExpressionEvaluatorManager.java
===================================================================
--- DefaultExpressionEvaluatorManager.java	(revision 44388)
+++ DefaultExpressionEvaluatorManager.java	(revision 44389)
@@ -1,6 +1,7 @@
 package org.gvsig.expressionevaluator.impl;
 
 import java.io.InputStream;
+import java.io.StringWriter;
 import java.net.URI;
 import java.net.URL;
 import org.gvsig.expressionevaluator.Grammar;
@@ -8,8 +9,11 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.gvsig.expressionevaluator.Bookmarks;
 import org.gvsig.expressionevaluator.Code;
 import org.gvsig.expressionevaluator.CodeBuilder;
@@ -25,6 +29,7 @@
 import org.gvsig.expressionevaluator.Compiler;
 import org.gvsig.expressionevaluator.GrammarSet;
 import org.gvsig.expressionevaluator.History;
+import org.gvsig.expressionevaluator.impl.javascripting.CosaScriptEngineFactory;
 import org.gvsig.tools.script.Script;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,7 +60,7 @@
         if( factory == null ) {
             return null;
         }
-        return factory.createSymbolTable();
+        return factory.create();
     }
 
     @Override
@@ -78,7 +83,7 @@
         Code code = compiler.compileExpression(source);
         return interpreter.run(code);
     }
-
+    
     @Override
     public Object evaluate(SymbolTable symbolTable, String source) {
         DefaultInterpreter interpreter = new DefaultInterpreter();
@@ -96,6 +101,43 @@
     }
 
     @Override
+    public String evaluatePage(String source) {
+        return evaluatePage(null, source);
+    }
+    
+    @Override
+    public String evaluatePage(SymbolTable symbolTable, String source) {
+        String[] sources = StringUtils.substringsBetween(source, "<%", "%>");
+        if( ArrayUtils.isEmpty(sources) ) {
+            return source;
+        }
+        String[] values = new String[sources.length];
+        
+        DefaultInterpreter interpreter = new DefaultInterpreter();
+        if( symbolTable!=null ) {
+            interpreter.setSymbolTable(symbolTable);
+        }
+        StringWriter writer = new StringWriter();
+        interpreter.setWriter(writer);
+        DefaultCompiler compiler = new DefaultCompiler();
+        for (int i = 0; i < sources.length; i++) {
+            String theSource = sources[i];
+            if( StringUtils.startsWith(theSource, "=") ) {
+                Code code = compiler.compileExpression(theSource.substring(1));
+                Object value = interpreter.run(code);
+                values[i] = Objects.toString(value, "");
+            } else {
+                Code code = compiler.compileExpression(theSource.substring(1));
+                writer.getBuffer().setLength(0);
+                interpreter.run(code);
+                values[i] = writer.toString();
+            }
+        }
+        String output = StringUtils.replaceEach(source, sources, values);
+        return output;
+    }
+    
+    @Override
     public Code compile(String source) {
         Compiler compiler = this.createCompiler();
         return compiler.compileExpression(source);
@@ -123,7 +165,7 @@
     public void populateSymbolTable(SymbolTable aSymbolTable) {
         for (SymbolTableFactory factory : this.getSymbolTableFactories() ) {
             if( factory.isAutoload() ) {
-                SymbolTable symbolTable = factory.createSymbolTable();
+                SymbolTable symbolTable = factory.create();
                 aSymbolTable.addSymbolTable(symbolTable);
             }
         }
@@ -196,7 +238,7 @@
         GrammarSet grammarSet = compiler.getGrammars();
         for (GrammarFactory factory : this.getGrammarFactories() ) {
             if( factory.isAutoload() ) {
-                Grammar grammar = factory.createGrammar();
+                Grammar grammar = factory.create();
                 grammarSet.add(grammar);
             }
         }
@@ -226,7 +268,7 @@
     
     @Override
     public Script createScript(String name, String code, String languaje) {
-        SimpleScript sc = new SimpleScript(name, code);
+        SimpleScript sc = new SimpleScript(this.createInterpreter(), name, code);
         return sc;
     }
 
@@ -250,7 +292,7 @@
         } finally {
             IOUtils.closeQuietly(is);
         }
-        return this.createScript(name, code, "COSA");
+        return this.createScript(name, code, CosaScriptEngineFactory.LANGUAGE_NAME);
     }
             
 }
