The Saxon Configuration object in the DLL is essentially one-to-one with the Processor object in the .NET API. Everything you do within an application must be under the control of the same Configuration and therefore the same Processor. So essentially, if you cache the XsltExecutable then you must also cache the Processor that was used to create it, and use this same Processor to create any source documents that are to be transformed using this XsltExecutable.
 
Michael Kay
http://www.saxonica.com/


From: Jan Kovařík [mailto:kovarikjan@gmail.com]
Sent: 23 September 2008 09:10
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Question about caching in saxon

Hi,
 
I'm using Saxon B dot net API and i encounter this problem. I use in my COM object HttpRuntime.Cache to store XsltExecutable object of the compiled stylesheet, then when i want to use it again it throws me this error messsage on (transformer.Run(serializer);)

Externally supplied NodeInfo belongs to the wrong Configuration v net.sf.saxon.Controller.transform(Source source, Result result) v Saxon.Api.XsltTransformer.Run(XmlDestination destination) v idnes.SaxonXslt.getFinalResult(Processor processor, XdmNode input, XsltTransformer transformer, TextWriter output)

I know, that i need to use the same configuration or set it to default(i've tried ((Controller)transformer.Implementation).getConfiguration();) but it does nothing.

Any help would be appreciated.

Jan Kovařík