[ http://issues.apache.org/jira/browse/XALANJ-2088?page=comments#action_64431 ] Mukul Gandhi commented on XALANJ-2088: --------------------------------------
Hello Mr. Minchau, I am happy with the present functionality. But I still feel, if we are able to pass initial mode from command line, its a nice feature. I am not justifying this idea "not due to loss of functionality". But because, it looks very natural. The example I gave above to simulate this feature (as suggested by Mr. Kesselman) meets the need.. But here, I am passing a "string parameter" from command line (which is the initial mode name). But the processor is calling a default mode template rule (<xsl:template match="/">).. And then, it is invoking the mode specific rule(with a xsl:choose or an xsl:if instruction). I feel(IMHO), it will be more natural, if the XSLT processor directly picks the root node template rule of a particular mode.. Regards, Mukul > Passing initial mode from command line > -------------------------------------- > > Key: XALANJ-2088 > URL: http://issues.apache.org/jira/browse/XALANJ-2088 > Project: XalanJ2 > Type: Improvement > Components: Xalan-CmdLine > Versions: 2.6 > Environment: Windows 2000 Prof, Xalan-J 2.6.0, JRE 1.4.2_03 > Reporter: Mukul Gandhi > Priority: Minor > > Hello, > For this problem, I need to compare Xalan-J with Saxon and MSXSL. Both Saxon > and MSXSL allow an initial mode to be passed to the transformation. Saxon has > option -im , and MSXSL has option -m . That is we should be able to define a > template rule for root node with a particular mode. > i.e. , as > <xsl:template match="/" mode="x"> > <!-- --> > </xsl:template> > This template rule does not give syntax error with Xalan(it should'nt as it > is a valid rule according to XSLT 1.0 grammer). But we cannot invoke it from > command line.. As Xalan command line does not have option to pass initial > mode. > We can only invoke template rules with default mode , i.e. > <xsl:template match="/"> > <!-- --> > </xsl:template> > The XSLT 1.0 spec explicitly says (section "5.8 Built-in Template Rules").. > <quote> > The following shows the equivalent of the built-in template rule for mode m. > <xsl:template match="*|/" mode="m"> > <xsl:apply-templates mode="m"/> > </xsl:template> > </quote> > This gives impression that the template rule for root node in an initial mode > exists. So the XSLT processor should provide an option to pass initial mode > to the transformation.. > But I cannot find anywhere in spec that this is a mandatory requirement(i.e. > passing initial mode). So I have not called this a bug, but as a "improvement > request" .. > Xalan might be providing this feature. But I am not aware about it.. If it > does, then I am sorry. > Regards, > Mukul -- 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]
