You appear to be trying to rebuild the Saxon package. Don't do this unless (a) you need to, and (b) you have the Java experience needed to do it.
The correct approach is simply to put the relevant JAR files on the classpath.
Michael Kay

From: [] On Behalf Of enis enis
Sent: 29 May 2006 10:26
Subject: [saxon] Using SAXON in a JAVA Application

Hello, I'm trying to test an example of a java class querying an XML document with the XQuery engine SAXON, but I always get errors in my class.

So, it would be helpful for me that someone gives me a full example (a java class) that implements querying within an XML document with SAXON.

All the class sources are in  the directory : java/jdk1.5/bin/souce.
My class is in : /java/jdk/bin.
The package "source" contains all the nessary classes : the API SAXON.

The error displayed :
"Bad Class file Configutation file does not contain class remove or make sure it appears in the correct subdirectory of the classpath".
[/code] Pourtant la classe Configuration existe bien dans le dossier source/net/sf/saxon/
package source;


public class XQuery2 {

    public static void main(String[] args) {
        Configuration conf = new Configuration();
        StaticQueryContext staticContext = new StaticQueryContext(conf);

        String query = "for $q in (<Root> <Hello>Hi! "
                + "</Hello>   <Name>Nice</Name>   </Root>) "
                + "return <HelloExample>{xs:string($q/Hello)} "
                + "{xs:string($q/Name)}</HelloExample> ";

        try {
            XQueryExpression xqe = staticContext.compileQuery(query);
            DynamicQueryContext dc = new DynamicQueryContext(conf);
            NodeInfo ob = (NodeInfo) xqe.evaluateSingle(dc);
            // It prints Hi! Nice in console
        } catch (XPathException e) {



thanks in advance.