[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Order of processing templates

Subject: Order of processing templates
From: "Karl Stubsjoen" <karl@xxxxxxxxxxxxx>
Date: Thu, 20 Feb 2003 00:36:12 -0700
order processing template
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.