[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Order of call-template
There is a very high likelihood that any XSLT processor will execute
these instructions in the order you write them, but it's not guaranteed
by the spec. For example, they could be executed in parallel. The only
guarantee in the spec is that in the result sequence, <outcode> and its
contents will precede <incode> and its contents.
Where processors ARE very likely to muck around with the ordering is when you use variables. If you wrote <xsl:variable name="i"> <incode> <xsl:call-template name="getIncode"> <xsl:with-param name="zip" select="'10001'"/> <xsl:with-param name="id" select="2"/> </xsl:call-template> </incode> </xsl:variable> <xsl:variable name="o"> <outcode> <xsl:call-template name="getOutcode"> <xsl:with-param name="zip" select="'10001"/> <xsl:with-param name="id" select="1"/> </xsl:call-template> </outcode> </xsl:variable> <xsl:copy-of select="$o, $i"/> Then you might well find different processors using a different order of execution. Of course, the only way you can tell is if the templates have side-effects (for example, if they call xsl:message). Michael Kay Saxonica On 22/06/2012 17:07, Ming Yu wrote: I have the following code in my xslt. Will it guarantee the first call-template to be executed before the second one?
|
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
|