DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=22217>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=22217 NullPointerException in TransformerImpl.run() when reusing XMLFilter object ------- Additional Comments From [EMAIL PROTECTED] 2004-07-02 22:36 ------- First I want to verify that Gretchen's fix >Additional Comments From Gretchen Chiaramonte 2003-09-22 20:04 ------- for this bug works for me as well using Xalan 2.6.0. Second, regarding: >Additional Comments From Igor Hersht 2003-08-12 22:59 ------- ... >If I recall correctly we had such discussion before. >We consider that as a wrong usage. >The correct method would be to create transformer and >to do multiple transformations like >transformer.transform(xmlSource,outputTarget); >transformer.transform(xmlSource,outputTarget); To help clarify what Gretchen has already implied, I believe that this doesn't complete the story. Xalan currently fails unneccessarily if "xmlSource" is an XMLFilter chain headed by an XML source The XMLFilter chain should be reusable with only the source is refreshed. But at the end of the TransformerImpl.transformNode() call, the DTMManager is erased by the call to XPathContext.reset() as cited by Gretchen. This manager is what binds the XMLFilter to e.g. its stylesheet. Therefore, until this bug is repaired, the filter chain cannot be reused. That's a shame because I suspect that setting up the filter chain (eg reading the stylesheet from disk) is more work than constructing the transformer. In case it isn't obvious, a workaround re-creates the XMLFilter chain each time is it transformed. I did not find this bug report at first. Sorting out why I was getting a NullPointerException was a lot of work, partly because Xalan is built in to the JDK runtime but the "endorsed" jar files are stored in common/endorsed under tomcat rather than JDK's endorsed (surprise ;-). In addition, Xalan has another bug in DTMManagerDefault.getDTM() (incorrectly returns the null this thread discusses) and one in TransformerImpl.run() (inappropriate throw calls). I will enter these as new bugs. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
