[ http://issues.apache.org/jira/browse/XALANJ-1174?page=all ] Morris Kwan closed XALANJ-1174: -------------------------------
> TCK: Transformer.setOutputProperties() should throw IllegalArgumentException > ---------------------------------------------------------------------------- > > Key: XALANJ-1174 > URL: http://issues.apache.org/jira/browse/XALANJ-1174 > Project: XalanJ2 > Type: Bug > Components: transformation, Xalan-interpretive > Versions: Latest Development Code > Environment: Operating System: All > Platform: All > Reporter: Morris Kwan > Assignee: Morris Kwan > > The Javadoc for Transformer.setOutputProperties() says that it should throw > an > IllegalArgumentException if any of the argument keys are not recognized and > are > not namespace qualified. The current implementation in > org.apache.xalan.transformer.TransformerImpl does not throw any exception. > Demonstration code: > import javax.xml.transform.*; > import javax.xml.transform.stream.*; > import java.util.*; > import java.io.*; > public class SetOutputPropertiesTest > { > private static String XSL1 = "<?xml version='1.0'?>" > + "<xsl:stylesheet" > + " version='1.0'" > + " > xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>\n" > + " <xsl:template match='/'>\n" > + " Hello World! \n" > + " </xsl:template>\n" > + "</xsl:stylesheet>"; > > public static void main(String[] args) > { > StreamSource source = new StreamSource(new StringReader(XSL1)); > > try { > Transformer transformer = TransformerFactory.newInstance > ().newTransformer(source); > > Properties properties = new Properties(); > properties.setProperty("xyz", "123"); > transformer.setOutputProperties(properties); > > System.out.println("Error: IllegalArgumentException not thrown"); > } > catch (IllegalArgumentException e) { > System.out.println("OK: IllegalArgumentException is thrown"); > } > catch (TransformerException e) { > System.out.println("Error: TransformerException is thrown"); > } > } > } > =========================================================================== > Expected output: > OK: IllegalArgumentException is thrown > Current output: > Error: IllegalArgumentException not thrown -- 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]