Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.0
-
None
-
Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
-
None
-
Operating System: All
Platform: PC
-
1205
Description
import java.io.FileInputStream;
import javax.xml.transform.Templates;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import org.xml.sax.helpers.AttributesImpl;
public class Test {
public static void main(String[] args) {
try
catch(Exception e)
{ e.printStackTrace(); } }
}
If you run this code with any valid in.xsl file, the template is instantiated
only once.
It's true, that in JAXP-1.1 specification it is not explicitly stated that
TransformerHandlers should be reusable, but it is stated that Transformers
should be reusable, and my opinion is that it would be reasonable and natural
to be able to reuse TransformerHandlers as well.