Thanks for the response. The cause wasn't exactly this, because we were already using  an URIResolver.  However we haven't set the system id for the resolved source. I've figured this out when I've looked into saxon sources. I should have done that in the first place :(

Best regards

Milan Ostry

______________________________________________________________
> Od: mike@saxonica.com
> Komu: "'Mailing list for SAXON XSLT queries'" <saxon-help@lists.sourceforge.net>
> Datum: 29.01.2007 14:48
> Pøedmìt: Re: [saxon] Cannot create Templates from stylesheets that resideinsidejar
>
>
>I will be "fixing" this in the next release: or more strictly, I will be
>introducing the same bug as is present in Xalan, in response to user demand.
>Here's the extract from the change log:
>
><p>On the Java platform, the <code>jar:</code> URI scheme is now supported.
>Previously URIs using this scheme could be dereferenced, but relative URIs
>could not be resolved against a base URI using this scheme. This is because
>the <code>java.net.URI</code> class doesn't handle such resolution, which in
>turn is because the syntax of URIs in this scheme does not actually follow
>the RFC specifications for hierarchic URIs. However, they are supported by
>the <code>java.net.URL</code> class, which Saxon now uses to perform
>resolution of these relative URIs. This means, for example, that it is
>possible to hold stylesheet modules in a JAR file and resolve
><code>xs:include</code> and <code>xs:import</code> references between files
>within the same JAR archive. For details of the <code>jar:</code> scheme see
>the javadoc for class <code>java.net.JARURLConnection</code>.</p>
>
>Technically this is non-conformant behavior. Relative URIs in xsl:include
>and xsl:import are supposed to be resolved as defined in RFC 2396, and if
>you do that, you get the current Saxon behavior, which is a consequence of
>the fact that Sun's (unregistered) "jar:" URI scheme does not follow the RFC
>syntax, and cannot be resolved using Sun's own java.net.URI implementation.
>
>I'm normally very reluctant to introduce a non-conformance into the product
>purely to improve usability or interoperability. However, in this case I
>think the damage done by Sun's poor decisions in this area cannot be undone,
>and the least I can do is mitigate the pain for users.
>
>Meanwhile, you can write your own URI resolver to handle this case: just
>detect that the "jar:" URI scheme is being used, and use the java.net.URL
>class to resolve the relative URI in place of the more standards-conformant
>java.net.URI.
>
>Michael Kay
>http://www.saxonica.com/
>> -----Original Message-----
>> From: saxon-help-bounces@lists.sourceforge.net > [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf > Of bukjakokluk@centrum.cz
>> Sent: 29 January 2007 13:17
>> To: saxon-help@lists.sourceforge.net
>> Subject: [saxon] Cannot create Templates from stylesheets > that reside insidejar
>> > > >  Hi,
>>   >   we are currently using Xalan as our XSLT processor within > JEE aplication deployed on Weblogic. We are considering > switching to saxon 6.5.5, but we encountered following error:
>>   >   Caused by: java.lang.NullPointerException
>>           at > com.icl.saxon.style.XSLGeneralIncorporate.getIncludedStyleShee
>> t(XSLGeneralIncorporate
>>           at > com.icl.saxon.style.XSLStyleSheet.spliceIncludes(XSLStyleSheet
>> .java:418)
>>           at > com.icl.saxon.style.XSLStyleSheet.preprocess(XSLStyleSheet.java:343)
>>           at > com.icl.saxon.PreparedStyleSheet.setStyleSheetDocument(Prepare
>> dStyleSheet.java:174)
>>           at > com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:131)
>>   >   There is only one master stylesheet in our application, all > others are included relative to this one. Stylesheets are > packed in a jar module and furthermore in a ear archive. The > code we used with Xalan to constuct templates:
>>  >  tFactory = TransformerFactory.newInstance();  url = > SomeClass.class.getResource(xslFile);
>>  templates = tFactory.newTemplates( new StreamSource( > url.openStream() ) );
>>  >  With saxon the exception described above is thrown on the > last statement.
>>  >  Thank you for any idea.
>>  >  Milan
>>  >   >   >  >  >  > > > --------------------------------------------------------------
>> -----------
>> Take Surveys. Earn Cash. Influence the Future of IT Join > SourceForge.net's Techsay panel and you'll get the chance to > share your opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge
>> &CID=DEVDEV
>> _______________________________________________
>> saxon-help mailing list
>> saxon-help@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>saxon-help mailing list
>saxon-help@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/saxon-help
>