[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Best Practice: How to include conditional snippets of
Hello friends, i hope you are feeling good besides of the war. My following question is regarding optimization for coding for following situation: I am on case1: then I have noticed that you cannot do <xsl:if test="$case = case2"><xsl:call-template name="transformSomething" > when you do not have defined the named template "transformSometing" for case1 because you don´t need it there. That must be of the funtional nature of this language, i imagine that the xsl-processor reserved adresses for all templates before starting to transform? I do know now following: file1 - specific (SITUATION case1) <xsl:template name="Case2"> <!-- do nothing --> </xsl:template> file2 - specific (SITUATION case2) <xsl:include href="case2.xsl"/> <xsl:template name="Case2"> <!-- Parameter getting from file3 frame.xsl --> <xsl:param name="case"/> <xsl:call-template name="transformSomething"> <xsl:with-param name="case" select="$case"/> </xsl:call-template> </xsl:template> both included the generic file 3 frame.xsl with folowing statement: <xsl:if test="$case = case2"><xsl:call-template name="Case2" > <xsl:with-param name="case" select="$case"/> The named template "transformSomething" is only defined in case2.xsl included only by file2 Do you think there are other more elegant or better ways for operating with conditional snippets of code? Thanks for your input, Peace, Hans Braumüller -- + -- Mail Art Not War http://crosses.net XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|