Subject: RE: [xsl] Order of template execution From: "Chris Bayes" <chris@xxxxxxxxxxx> Date: Thu, 20 Dec 2001 08:04:56 -0000 |
Samuel, 1. Yes. It depends on the priority of the temlpate. See http://www.w3.org/TR/xslt#conflict If you aren't importing any other templates then the priority is worked out depending on how specific a template is. i.e. match="x" will have lower priority than match="x[@a]". If there are 2 templates with the same priority then the processor can either error or use the last template in the stylesheet. To get around this you can put a priority attribute on the template to avoid conflicts. The spec says that this can be any + or - number but msxml requires it to be between +/- 9. 2. No. But you can use the result from one template as the input to another. i.e. <xsl:variable name="result1"> <xsl:call-template name="template1" /> </xsl:variable> <xsl:variable name="result2"> <xsl:apply-templates select="xx:node-set($result1)" /> </xsl:variable> Note that $result1 is an RTF so you need to use the node-set function on it to use it. Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Samuel Abraham > Sent: 20 December 2001 01:32 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Order of template execution > > > > > hi, > > In an xsl file i have templates in this order > > Template 1 > Template 2 > Template 3 > > 1)Is there any order in which the templates are executed? > If I change the order will the result change? > > 2)Will the change made by one template affect the source tree? > Or can I use the result produced by the first template as > the source tree for the > templates following? > > thanks > Samuel Abraham > > > > -- > > This e-mail may contain confidential and/or privileged > information. If you are not the intended recipient (or have > received this e-mail in error) please notify the sender > immediately and destroy this e-mail. Any unauthorized > copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Order of template execution, Samuel Abraham | Thread | RE: [xsl] Order of template executi, Michael Kay |
RE: [xsl] How to express a select a, Chris Bayes | Date | RE: [xsl] Template problem.Unnecess, Chris Bayes |
Month |