เป็นไปได้อย่างไรที่ TransformerFactory.newInstance().newTransformer(streamSource) คืนค่า null ตาม javadoc สิ่งนี้เป็นไปไม่ได้: http://download.oracle.com/javase/6/docs/api/javax/xml/transform/TransformerFactory.html#newTransformer(javax.xml.transform.Source)
นี่คือตัวอย่างโค้ด Groovy
def is = new ClassPathResource('xslt/MySpace-Contact.xsl').inputStream
println is
def streamSource = new StreamSource(is)
println streamSource
def factory = TransformerFactory.newInstance()
println factory
def tr = factory.newTransformer(streamSource)
println tr
นี่คือผลลัพธ์:
--Output from testTransformation--
java.io.BufferedInputStream@32999f10
javax.xml.transform.stream.StreamSource@399ed64
org.apache.xalan.processor.TransformerFactoryImpl@6eb04214
null
factory
2 ครั้ง - person tenshi   schedule 31.01.2011