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

Re: No Subject [variable timing problem]

Subject: Re: No Subject [variable timing problem]
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Thu, 31 Jan 2002 18:19:54 -0800
variable timing
Although this looks like a bug in your processor, assuming it is not caused 
by something else such as a bug in the encode template, you might try nesting 
the <xsl:call-template> calls:

<xsl:variable name="value1">
  <xsl:call-template name="encode">
    <xsl:with-param name="inString">
      <xsl:call-template name="encode">
        <xsl:with-param name="inString" select="string(.)"/>
        <xsl:with-param name="oldChars" select="'%'"/>
        <xsl:with-param name="newChars" select="'%25'"/>
      </xsl:call-template>
    </xsl:with-param>
    <xsl:with-param name="oldChars" select="' '"/>
    <xsl:with-param name="newChars" select="'%20'"/>
  </xsl:call-template>
</xsl:variable>

This should eliminate the need for having 2 different variables.  You could 
also replace the <xsl:value-of select="$value2"/> call below with the first 
<xsl:call-template> and eliminate the need for all the variables.

On Wednesday 30 January 2002 06:59, Jay Burgess wrote:
> (Since my previous post didn't get any responses, I'm trying again, but
> this time stating my problem purely in terms of XSL.)
>
> Below is a simple encode template for name/value pairs in the query string
> of a URL.  Is there a better way to do this?  The reason I'm asking is that
> it doesn't always work, and in the cases it fails, it appears like the
> "value2" variable is trying to initialize before "value1" is fully defined
> (timing problem?).
>
> <xsl:template name="param">
>      <xsl:variable name="value1">
>          <xsl:call-template name="encode">
>              <xsl:with-param name="inString" select="string(.)"/>
>              <xsl:with-param name="oldChars" select="'%'"/>
>              <xsl:with-param name="newChars" select="'%25'"/>
>          </xsl:call-template>
>      </xsl:variable>
>      <xsl:variable name="value2">
>          <xsl:call-template name="encode">
>              <xsl:with-param name="inString" select="string($value1)"/>
>              <xsl:with-param name="oldChars" select="' '"/>
>              <xsl:with-param name="newChars" select="'%20'"/>
>          </xsl:call-template>
>      </xsl:variable>
>      <xsl:text>"&#38;</xsl:text><xsl:value-of
> select="@name"/><xsl:text>="</xsl:text><xsl:value-of select="$value2"/>
> </xsl:template>
>
> Thanks.
>
> Jay
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
Peter Davis
Show business is just like high school, except you get paid.
		-- Martin Mull

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • [no subject]
    • Jay Burgess - Wed, 30 Jan 2002 09:58:30 -0500 (EST)
      • Michael Kay - Wed, 30 Jan 2002 11:37:28 -0500 (EST)
      • Peter Davis - Thu, 31 Jan 2002 21:18:03 -0500 (EST) <=

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.