hi,
my xml is coming with a pipe separated values for two attributes (Domain and
Desc) of an element which i want to display as a select list. im using the
xalan:tokenize extension function to convert the pipe separated string into
a nodeset...however, this seems to be taking considerable time to process as
i have nearly 100 tokens or 100 items in a select list...prior to this, i
had used a recursive template with xsl substring functions to achieve the
same functionaity..i had switched to tokenize in the hope that it will be
faster but it turned out to be slower...am i missing something here...
<xsl:template name="selectbox">
<xsl:param name="name" select="name()"/>
<xsl:param name="value" select="."/>
<xsl:param name="domain" select="@Domain"/>
<xsl:param name="desc" select="@Desc"/>
<xsl:param name="disabled"/>
<xsl:param name="funcname"/>
<xsl:param name="style"/>
<xsl:param name="separator" select="'|'"/>
<xsl:param name="selected" select="@Selected"/>
<xsl:param name="displayselectedvalue"/>
<!--<xsl:param name="fieldname"/>-->
<xsl:variable name="domaintokens"
select="xalan:tokenize($domain,$separator)"/>
<xsl:variable name="desctokens"
select="xalan:tokenize($desc,$separator)"/>
<select name="{$name}" style="{$style}">
<option/>
<xsl:for-each select="$domaintokens">
<option>
<xsl:choose>
<xsl:when test="(.=$value) and
(not($displayselectedvalue))">
<xsl:attribute
name="selected"/>
</xsl:when>
</xsl:choose>
<xsl:attribute name="value"><xsl:value-of
select="."/></xsl:attribute>
<xsl:call-template name="getDesc">
<xsl:with-param name="position"
select="position()"/>
<xsl:with-param name="desctokens"
select="$desctokens"/>
</xsl:call-template>
</option>
</xsl:for-each>
</select>
</xsl:template>
<xsl:template name="getDesc">
<xsl:param name="position"/>
<xsl:param name="desctokens"/>
<xsl:for-each select="$desctokens[position()=$position]">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com