|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Order of processing templates
Hello,
How does one *best* control the flow/process by which templates are
followed? I assumed that it would be a top to bottom processing mechanism,
but it does not necessarily seem so.
So far, I have bee taking advantage of the XPATH syntax and am doing well at
looping through different collections of nodes. However, just recently, I
had two template calls one after each other, but the 2nd one processed
first. This is a big nono, since I'm dependent on the order in which these
output.
Should I be using <xsl:for-each...> opposed to straight xpath matches?
Here is a snipet of the XSL where the 2nd apply-template fired before the
first:
<xsl:template match="/">
select
<xsl:apply-templates
select="xml/s:Schema/s:ElementType/s:AttributeType[check='true']"/> from
<xsl:value-of select="$table"/>
<xsl:apply-templates
select="xml/s:Schema/s:ElementType/s:AttributeType[where!='']"/>
</xsl:template>
<xsl:template
match="xml/s:Schema/s:ElementType/s:AttributeType[check='true']">
<xsl:value-of select="@name"/>
<xsl:if test="position()!=last()">,</xsl:if>
</xsl:template>
<xsl:template
match="xml/s:Schema/s:ElementType/s:AttributeType[where!='']">
<xsl:if test="position()=1">
where
</xsl:if>
<xsl:value-of select="@name"/>=
<xsl:value-of select="where"/>
</xsl:template>
Thanks for the help!
Karl
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
|

Cart








