You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Suresh Babu Koya <sk...@quark.co.in> on 2002/09/05 16:56:34 UTC

SAX2SAX example failed with XSL

Hi,

  I have tried running the SAX2SAX example with Xalan2.3 using a XSL
attached. The example succesfully runs with Xalan 2.0 but failed with Xalan
2.3 and throws the following list of exceptions.


java.lang.RuntimeException: java.lang.NullPointerException 	
at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3231)

at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH
andlerImpl.java:436) 	
at
org.apache.xerces.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.ja
va:735) 	
at
org.apache.xerces.impl.XMLNamespaceBinder.endDocument(XMLNamespaceBinder.jav
a:704) 	
at
org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(XMLDTDValidator.java:
945) 	
at
org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerIm
pl.java:451) 	
at
org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1228
) 	
at
org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.
java:3275) 	
at
org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityMa
nager.java:2974) 	
at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc
h(XMLDocumentScannerImpl.java:1002) 	
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.java:333) 	
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)

at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)

at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) 	
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:110
8) 	
at sax2saxtest.SAX2SAX.main(SAX2SAX.java:99)


The code for extension function I used is :

package sax2saxtest;
public class SumFunc {

  public String sum(String str1,String str2){
    try{
      return String.valueOf(Double.parseDouble(str1)+
Double.parseDouble(str2));
    } catch(Exception e){
        return "";
    }
  }
} 

What could be the problem. My extension function itself is not invoked with
Xalan 2.3 whereas in Xalan2.0 it works fine.
Was there a change in invoking extension functions in 2.3. I did a diff in
the sample code for extension but I could not find any difference.

--Suresh  
 <<2.xsl>> 

Re: SAX2SAX example failed with XSL

Posted by Joseph Kesselman <ke...@us.ibm.com>.
Tried it on my system, and once I got the classpath set correctly to 
include your extension it seemed to work. It did take me a bit of fiddling 
to get the classpath right, admittedly.


______________________________________
Joe Kesselman  / IBM Research