Robert, Could you attach your stylesheet? Also, would it be possible to simplify your code to avoid calling methods from the Lsb class. I'm just trying to see how we can easily reproduce this problem.
Thanks. -- Santiago On Tue, 2003-10-21 at 12:24, Robert Koberg wrote: > Hi, > > OK, thanks for looking into it. It seems to be worse than before. Can you > spot something I might be doing wrong for XSLTC below (as I mention below, > the simple transform works in xalan interpretive, saxon and jd.xslt). > > I just checked out 'xml-xalan' and ran: > > $xml_xalan/java/build.bat fulldist site -logfile ../fulldist.log > > (I am using apache-ant-1.6beta...) > > I put the C:\xml-xalan\java\build\xalan.jar in my: > C:\j2sdk1.4.2\jre\lib\endorsed > > > I first tried a simple (no resolvers) transformation: > ... > Templates xsl = Lsb.getTemplates( "lsb.work.views.xsl.login", "login" ); > Source xml = new StreamSource( > Lsb.viewsLookup( "lsb.work.views.xml.login" ).openRead() ); > Transformer transformer = xsl.newTransformer(); > // on this transform error="" > transformer.setParameter( "error", error ); > res.setContentType( "text/html" ); > transformer.transform( xml, new StreamResult( out ) ); > ... > > This worked with interpretive xalan, saxon, jd.xslt. But when I tried it > with xsltc, I get the following errors: > > Lsb.getTemplates: /c:/home/app/lsbwork/WEB-INF/views/login/login.xsl > Lsb.getTemplates templates: [EMAIL PROTECTED] > ERROR: '' > TransformFilter: javax.xml.transform.TransformerException: > java.lang.NullPointerException > javax.xml.transform.TransformerException: java.lang.NullPointerException > at > org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:7 > 12) > at > org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:3 > 07) > at com.livestoryboard.actions.login.Login.service(Unknown Source) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:103) > at > com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:9 > 6) > at com.caucho.server.http.Invocation.service(Invocation.java:315) > at > com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135) > at > com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246) > at > com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164) > at com.caucho.server.TcpConnection.run(TcpConnection.java:139) > at java.lang.Thread.run(Thread.java:534) > Caused by: java.lang.NullPointerException > at > org.apache.xalan.xsltc.runtime.BasisLibrary.compare(BasisLibrary.java:797) > at GregorSamsa.template$dot$0() > at GregorSamsa.applyTemplates() > at GregorSamsa.transform() > at > org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.j > ava:545) > at > org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:7 > 02) > ... 10 more > --------- > java.lang.NullPointerException > at > org.apache.xalan.xsltc.runtime.BasisLibrary.compare(BasisLibrary.java:797) > at GregorSamsa.template$dot$0() > at GregorSamsa.applyTemplates() > at GregorSamsa.transform() > at > org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.j > ava:545) > at > org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:7 > 02) > at > org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:3 > 07) > at com.livestoryboard.actions.login.Login.service(Unknown Source) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:103) > at > com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:9 > 6) > at com.caucho.server.http.Invocation.service(Invocation.java:315) > at > com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135) > at > com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246) > at > com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164) > at com.caucho.server.TcpConnection.run(TcpConnection.java:139) > at java.lang.Thread.run(Thread.java:534) > > > > > > -----Original Message----- > > From: Henry Zongaro [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, October 21, 2003 8:24 AM > > To: [EMAIL PROTECTED] > > > > Hi Robert, > > > > I'm not able to reproduce the problems that you describe, so I don't > > know whether these problems were corrected by Santiago recently or by > > somebody else. Have you tried using the latest code in CVS (or the latest > > nightly build)? Do you have a test case that demonstrates this problem? > > > > If you still see the problem using the latest code, please open a bug > > report, with a complete, stand-alone test case. > > > > Thanks, > > > > Henry > > ------------------------------------------------------------------ > > Henry Zongaro Xalan development > > IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 > > mailto:[EMAIL PROTECTED] > > > > > > > > > > "Robert Koberg" <[EMAIL PROTECTED]> > > 2003-10-17 08:45 AM > > Please respond to xalan-dev > > > > > > To: <[EMAIL PROTECTED]> > > cc: > > Subject: RE: Xalan Java 2.5.2 > > > > > > > > Hi, > > > > There is another inconsistency between xalan and xsltc. > > > > Overview: > > > > According to most API's you can set a URIResolver on the > > TransformerFactory > > and one on the Transformer. Generally, the resolver set on the > > TransformerFactory resolves xsl:includes and xsl:imports. If set on the > > Tranformer it resolves document() function calls. > > > > ----- > > > > The bug/inconsistency: > > > > - standard xalan requires you to set a URIResolver on the > > TransformerFactory > > for xsl:include and xsl:import and set one on the Transformer for > > document() > > > > - xsltc xalan uses the TransformerFactory for both xsl:include/xsl:import > > and document() -- you cannot set a resolver on the Transformer for > > document(), like the standard xalan. > > > > -- > > FYI: > > - Saxon allows you to set a resolver on the TransformerFactory to resolve > > both includes/imports and document(). > > It also lets you set one for the factory and one for the transformer. When > > this is done the factory resolves include/import and the transformer > > resolves document(). This is the best way, because, in IMHO, you get the > > Transformer from the factory, so if you don't set one on the Transformer > > it > > defaults to the one set on the factory. > > > > I would hope that both xalan and xsltc would follow Saxon's approach. > > > > Best, > > -Rob > > > > >
