[ http://issues.apache.org/jira/browse/XALANJ-1175?page=all ]
Morris Kwan closed XALANJ-1175:
-------------------------------
Assign To: (was: Xalan Developers Mailing List)
> TCK: Error transforming no argument DOMSource
> ---------------------------------------------
>
> Key: XALANJ-1175
> URL: http://issues.apache.org/jira/browse/XALANJ-1175
> Project: XalanJ2
> Type: Bug
> Components: transformation, Xalan-interpretive
> Versions: Latest Development Code
> Environment: Operating System: All
> Platform: All
> Reporter: Morris Kwan
>
> From the Javadoc for the no argument DOMSource() constructor:
> Zero-argument default constructor. If this is used, and no DOM source is set,
> then the Transformer will create an empty source Document using
> DocumentBuilder.newDocument().
> The current implementation throws an exception instead of creating an empty
> Document. There is a similar problem with the no argument SAXSource and
> StreamSource.
> Code:
> import javax.xml.transform.*;
> import javax.xml.transform.dom.*;
> import javax.xml.transform.stream.*;
> public class DOMSourceTest
> {
> public static void main(String[] args)
> {
> try {
> Transformer transformer = TransformerFactory.newInstance
> ().newTransformer();
> StreamResult result = new StreamResult(System.out);
> DOMSource source = new DOMSource();
> transformer.transform(source, result);
>
> System.out.println("Passed");
> }
> catch (TransformerException e) {
> System.out.println("Failed: TransformerException is thrown");
> }
> }
> }
> =======================================================================
> Expected output:
> Passed
> Current output:
> Exception in thread "main" java.lang.IllegalArgumentException: The input node
> ca
> n not be null for a DOMSource for newTemplates!
> at
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf
> ormerIdentityImpl.java:346)
> at DOMSourceTest.main(DOMSourceTest.java:13)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]