The problem is in using
   new Processor(false)
In 9.2 the documentation for this method has clarified the way it works:
The argument needs to be set to true.
In the past, with Saxon-SA, schema-awareness was the main feature of the commercial edition of the software, and so "schema-aware" and "licensed edition" were pretty well synonymous. Saxon-EE offers a lot more than schema-awareness, so switches like this have to be more carefully defined.
If you set this flag to false, then the Saxon.API dll will load Saxon9 HE instead of Saxon9 EE, and update capability will therefore not be available.


Michael Kay


From: Abhisek Bhowmik []
Sent: 12 February 2010 06:16
Subject: [saxon] Problem in Update using Saxon - URGENT !!


I am unable to update a XML using XML Modify. Please find the snippets below.

Saxon Details
Saxon EE 9.2 / Evaluation License (saxon9ee-api.dll, saxon9ee.dll)

.Net Code
                 factory = new ConverterFactory();
                 resolver = factory.CreateResolver();
                 processor = new Processor(false); // Create a non schema-aware Processor.
                processor.XmlResolver = resolver;

                XQueryCompiler xqCompiler = processor.NewXQueryCompiler();
                xqCompiler.BaseUri = xqueryUri;
                XQueryEvaluator evaluator;
                using (Stream xqueryStream = File.OpenRead(xqueryPath))
                    xqCompiler.UpdatingEnabled = true;
                    //xqCompiler.XQueryLanguageVersion = "1.1";
                    evaluator = xqCompiler.Compile(xqueryStream).Load();
                evaluator.InputXmlResolver = resolver;
                UriSource source = new UriSource(inputUrl);
                ConvertToXml convToXml = factory.CreateConvertToXml(ediURI);
                    using (XmlReader inputReader = convToXml.GetXmlReader(source))
                        using (Stream output = new FileStream(outputFile, FileMode.Create, FileAccess.Write, FileShare.None))
                            Serializer srializer = new Serializer();
                            // Setup initial xquery context
                            evaluator.ContextItem = processor.NewDocumentBuilder().Build(inputReader);




The line marked in red throws up exception .

Error Details
XQuery syntax error in #... copy $#:
    Unexpected token "copy" in path expression
if xqCompiler.UpdatingEnabled = true

XQuery Update is supported only in Saxon-EE

Xquery Details
$doc4010 := .
modify (rename node $doc ....

Steps Done
Followed steps for Saxon Installation as in
(places saxon-license.lic in '%SAXON_HOME%/bin' and the application 'bin' folder.

Please Help !!

Thanking in anticipation..