qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] Newbee problems


From: Ayal Spitz
Subject: [Qexo-general] Newbee problems
Date: 09 Jan 2003 10:25:59 -0500

Hello All -

I've been trying to get the following code to work for a bit now and
can't seem to figure out what's wrong. The code it self is straight
forward enough. It works when I use this line "exp = "for $x in (3,4,5)
return <a>{$x}</a>";" but when I try "exp = "string(<a>3+5 is
{3+5}</a>)";" I get the following:

>java -cp ../kawa/kawa-1.6.99.jar:Qexo.jar spitz.ayal.qexo.Qexo
string(<a>3+5 is {3+5}</a>) => gnu.mapping.UnboundSymbol: Unbound symbol
string
        at
gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:610)
        at gnu.expr.Interpreter.getSymbolValue(Interpreter.java:617)
        at gnu.expr.ReferenceExp.eval(ReferenceExp.java:104)
        at gnu.expr.ApplyExp.eval(ApplyExp.java:52)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:160)
        at gnu.expr.Interpreter.eval(Interpreter.java:588)
        at gnu.expr.Interpreter.eval(Interpreter.java:569)
        at gnu.expr.Interpreter.eval(Interpreter.java:551)
        at gnu.expr.Interpreter.eval(Interpreter.java:545)
        at spitz.ayal.qexo.Qexo.<init>(Qexo.java:40)
        at spitz.ayal.qexo.Qexo.main(Qexo.java:20)

Anyone have any ideas? Do I need to specifically include any directories
or jars? I'm using a fresh copy of Kawa that I grabbed from the CVS
repository this morning.

Any help would be appreciated - Thanks - AYAL

Src code bellow - 
package spitz.ayal.qexo;

import gnu.xquery.lang.XQuery;
import gnu.xml.XMLPrinter;

import java.io.OutputStreamWriter;
import java.io.Writer;

/**
 *
 * @author  aspitz
 */
public class Qexo{
    public static void main(String[] args){ new Qexo(); }
    
    public Qexo(){
        XQuery          xQuery = null;
        Writer          systemOutWriter = null;
        XMLPrinter      xmlPrinter = null;
        String          exp = null;
        Object          result = null;
        
        xQuery = new XQuery();
        systemOutWriter = new OutputStreamWriter(System.out);
        xmlPrinter = new XMLPrinter(systemOutWriter);
        //exp = "for $x in (3,4,5) return <a>{$x}</a>";
        exp = "string(<a>3+5 is {3+5}</a>)";
        //exp = "string-value(<a>3+5 is {3+5}</a>)";
        
        System.out.print(exp);
        System.out.print(" => ");
        
        try{
            xQuery.eval(exp,xmlPrinter);
            //result = xQuery.eval(exp);
        }catch(Throwable t){ t.printStackTrace(); }
        
        //System.out.println(result);
        xmlPrinter.println();
        xmlPrinter.flush();
    }    
}


Ayal Spitz <address@hidden>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]