You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Rick Bullotta <Ri...@lighthammer.com> on 2001/01/18 21:29:36 UTC

Xalan2 D07, XalanJ1 compatibility bug?

It appears that calling the getStylesheet() method on an XSLTProcessor
object returns null even if a valid stylesheet has been loaded by the
processor.  I noticed this when attempting to call the getOutputMediaType()
method.  A null pointer exception was thrown, which I later realized was
actually a null coming back from getStylesheet.  Identical code, of course,
works fine with Xalan 1.2.2.  The following code is called just prior to the
getStylesheet method, and doesn't throw an exception.  Perhaps the problem
is with processStylesheet?

try {
	processor =
XSLTProcessorFactory.getProcessorUsingLiaisonName("org.apache.xalan.xpath.xd
om.XercesLiaison");
	xsldoc = XMLHandler.getDocument(sStylesheet);
	xsldocinput = new XSLTInputSource(xsldoc);
	processor.processStylesheet(xsldocinput);
}
catch(Exception e){
	processor = null;
	mManager.getErrorHandler().addNonFatalMessage("Stylesheet [" + sStylesheet
+ "] was not found or could not be read.");
}

Regards,

Rick Bullotta
CTO
Lighthammer Software