On 5/17/2013 5:23 PM, Greg Sharek wrote:
Hi all,

I'm working on a project which includes SaxonEE, but allows the user to use SaxonHE if they don't have a Saxon license.    Our "no license" code path uses net.sf.saxon.TransformerFactoryImp
I ended up with a code path like this:

 private static Processor makeProcessor () {
        try {
            if (Class.forName("com.saxonica.config.EnterpriseConfiguration") != null) {
                return new Processor (true);
            }
        } catch (ClassNotFoundException e) { }
        try {
            if (Class.forName("com.saxonica.config.ProfessionalConfiguration") != null) {
                return new Processor (true);
            }
        } catch (ClassNotFoundException e) { }
        Processor p = new Processor (new Config());
        return p;
    }

which detects which version is on the class path, and if it's PE or EE, creates the Processor as licensed, and otherwise, as unlicensed.