Hi,

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
try
            {
                 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();
                            srializer.SetOutputStream(output);
                            // Setup initial xquery context
                            evaluator.ContextItem = processor.NewDocumentBuilder().Build(inputReader);
                            evaluator.Run(srializer);
                            srializer.Close();
                        }

                    }

                }

            }

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
copy
$doc4010 := .
modify (rename node $doc ....


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


Please Help !!

Thanking in anticipation..



Regards,
Abhisek