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

RE: Order of processing templates

Subject: RE: Order of processing templates
From: "Pilarski,James" <James.Pilarski@xxxxxxxxx>
Date: Fri, 21 Feb 2003 09:52:29 -0600
jim pilarski
Karl,

When you say the second template is processed first, do you mean that:

<xsl:apply-templates select="xml/s:Schema/s:ElementType/s:AttributeType[check='true']"/>

is matching on:

<xsl:template match="xml/s:Schema/s:ElementType/s:AttributeType[where!='']">

???

If this is the case, make certain that the predicates in your XPaths are not evaluating to the same value.  Regardless, have you tried assigning a mode to your templates?  An example of mode could be:

<xsl:template match="/">
	select
	<xsl:apply-templates select="xml/s:Schema/s:ElementType/s:AttributeType[check='true']" mode="first"/> from
	<xsl:value-of select="$table"/>
 	<xsl:apply-templates select="xml/s:Schema/s:ElementType/s:AttributeType[where!='']" mode="second"/>
</xsl:template>

<xsl:template match="xml/s:Schema/s:ElementType/s:AttributeType[check='true']" mode="first">
	<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!='']" mode="second">
	<xsl:if test="position()=1">
	where
	</xsl:if>
	<xsl:value-of select="@name"/>=
	<xsl:value-of select="where"/>
</xsl:template>

Jim

 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.