I have a fairly large transformation that runs very quickly (about 4 sec) when called from the command line with transform.exe.  In fact, it did a lot better than Altova’s engine with the same transformation.

 

But when I try the same transformation with the .net Saxon components (code below), it runs for over 70 sec.  Am I doing something wrong?  Do I need to buy the “SA” version to get the faster .net components or something?

 

Thanks!

Steve

 

// Create a Processor instance.

Processor processor = new Processor();

 

// Load the source document

XdmNode input = processor.NewDocumentBuilder().Build(new Uri(@"C:\TestSaxon\PortfolioSnapshot\PortfolioSnapshots.xml"));

 

// Create a transformer for the stylesheet.

XsltTransformer transformer = processor.NewXsltCompiler().Compile(new Uri(@"C:\TestSaxon\PortfolioSnapshot\PortfolioSnapshot_In1.xslt")).Load();

 

// Set the root node of the source document to be the initial context node

transformer.InitialContextNode = input;

 

// Create a serializer

String outfile = @"C:\TestSaxon\Output.xml";

Serializer serializer = new Serializer();

serializer.SetOutputStream(new FileStream(outfile, FileMode.Create, FileAccess.Write));

 

// Transform the source XML to System.out.

transformer.Run(serializer);