Correction: The preliminary testing did NOT return the error that we got with the .Net version.

 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Harold Palacio
Sent: Friday, May 18, 2007 3:31 PM
To: Michael Kay; Mailing list for SAXON XSLT queries
Subject: Re: [saxon] XsltTransformer DynamicError

 

The Java terms did throw me for a second. It took me a moment to find some references in the API documentation.

 

The source document is created by our Profiler Kernel application. It could be possible that it generated an error in the source document. However, we also use the same source document to run against the Saxon Java transformation and preliminary testing did return the error that we got with the .Net version.

 

Harold

 


From: Michael Kay [mailto:mike@saxonica.com]
Sent: Friday, May 18, 2007 2:56 PM
To: Harold Palacio; 'Mailing list for SAXON XSLT queries'
Subject: RE: [saxon] XsltTransformer DynamicError

 

Sorry to be using the terminology of the underlying Java classes: I forgot you were using the .NET API!

 

The property values here aren't a problem. The thing that's missing is, how is the source document (the input to the transformation) constructed?

 

Michael Kay

http://www.saxonica.com/

 


From: Harold Palacio [mailto:harold.palacio@hotsos.com]
Sent: 18 May 2007 20:05
To: Michael Kay; Mailing list for SAXON XSLT queries
Subject: RE: [saxon] XsltTransformer DynamicError

I’ve made slight progress. I created a test project that isolates the transformation process so that I can eliminate some variables. My first test gave a different transform error that indicates that I reached an undefined parameter. It’s probably my mistake so I’m crawling down that rabbit hole right now.

 

I still have the name pool error in our development environment so I’m still working on what’s causing it and how to handle it.

 

Here are the steps that I take to create my XsltTransformer:

 

    XsltExecutable executable = null;

    XsltTransformer transformer = null;

    XsltCompiler compiler = null;

    Processor processor = null;

 

    processor = new Processor();

 

    compiler = processor.NewXsltCompiler();

    compiler.ErrorList = new System.Collections.ArrayList();

    compiler.BaseUri = new Uri(xsltSource);

 

    // Create an executable stylesheet from a URI

    executable = compiler.Compile(new Uri(xsltSource));

 

    transformer = executable.Load();

 

The Transformer object is stored until it’s time to Run. As I understand it the Configuration that you refer to is created and stored in the Processor object. Your response prompted me to investigate these steps and right away I found that the Transformer had 2 properties with exceptions:

 

The BaseOutputUri property had an exception message “Value cannot be null.” The stacktrace look like this:  

   at System.Uri..ctor(String uriString)

   at Saxon.Api.XsltTransformer.get_BaseOutputUri()

 

The InitialMode property had an exception message “Unknown name code -1”

   at net.sf.saxon.om.NamePool.unknownNameCode(Int32 i)

   at net.sf.saxon.om.NamePool.getClarkName(Int32 i)

   at net.sf.saxon.Controller.getInitialMode()

   at Saxon.Api.XsltTransformer.get_InitialMode()

 

I didn’t notice these before and wonder how these exceptions weren’t thrown during initialization. So, at this point I began creating the test project so that I could test outside of our application source and also compare the differences between 8.6 and 8.9. I wanted to make sure these weren’t silly mistakes on my part before I posted more questions.

 

Harold

 


From: Michael Kay [mailto:mike@saxonica.com]
Sent: Friday, May 18, 2007 12:55 PM
To: 'Mailing list for SAXON XSLT queries'
Cc: Harold Palacio
Subject: RE: [saxon] XsltTransformer DynamicError

 

I just realised I misinformed you slighly on this one. Since Saxon 8.9 it's no longer true that Saxon by default uses a single static NamePool: it now uses a different NamePool for each Configuration. It's still true that compiling the stylesheet and building the source document must be done under the same Configuration and therefore the same NamePool.

 

Have you made any progress with the problem?

 

Michael Kay

http://www.saxonica.com/

 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: 17 May 2007 00:11
To: 'Mailing list for SAXON XSLT queries'
Subject: Re: [saxon] XsltTransformer DynamicError

Saxon introduced some tighter checking, I think it was in 8.7 or perhaps 8.8, to ensure that the source document and the compiled stylesheet use the same mapping of integer name codes to actual QNames. Without this checking you could get some rare but very difficult to diagnose failures.

 

Saxon rarely creates a NamePool itself (by default it uses the same static NamePool all the time), so this is likely to mean that you are creating a NamePool from within your own code. I know that Hotsos uses stylesheet compilation extensively and the problem could be in that area (though I wasn't aware that stylesheet compilation worked on .NET...)

 

In fact it's much more common to get errors saying that the are multiple Configurations in use, rather than multiple NamePools. If the stylesheet and source document were built using the same Configuration (or the same TransformerFactory) then they will automatically use the same NamePool, unless you change the NamePools attached to the Configuration in mid-fllight, which would be fatal.

 

Michael Kay

http://www.saxonica.com/

 

 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Harold Palacio
Sent: 16 May 2007 22:10
To: saxon-help@lists.sourceforge.net
Subject: [saxon] XsltTransformer DynamicError

Hello,

 

I’ve recently upgraded from Saxon .Net 8.6 to 8.9 and during unit testing I reached an error that has gotten me a little stumped. The error is a DynamicError with the message “Source document and stylesheet must use the same name pool”. There are some other properties of the error which did not give me much help: URI=”” and LineNumber=-1.  

 

I’ve searched the List archives and Google’d for this error and have found very little information to help troubleshoot this problem. Can somebody give me a hint to what would cause this error? Any help is much appreciated.

 

Harold