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

RE: construct query string

Subject: RE: construct query string
From: sara.mitchell@xxxxxxxxx
Date: Tue, 7 May 2002 16:19:13 -0400
construct query
I think you may need to simply redefine how you think 
about this to get the result you want. Instead of 
'create variable, loop through and add on', think of 
'declare variable and inside loop through'. 

So, something like: 

<xsl:variable name="myparam">
<xsl:text>?</xsl:text>
<xsl:for-each select="//param">
&amp;<xsl:value-of select="name()"/>=<xsl:value-of select="."/>
</xsl:for-each>
</xsl:variable>

This isn't exactly right (it doesn't account for no & for the first
param)...but it is the general idea. When you create the variable, 
you do the loop *inside* rather than after. 

Sara

> -----Original Message-----
> From: Zack Angelo [mailto:zack@xxxxxxxxxxxxxxxx]
> Sent: Tuesday, May 07, 2002 12:37 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  construct query string
> 
> 
> I'm attempting to construct a query string 
> ("?param1=blah&param2=blah2",
> for example) using the values of a series of tags in an XML 
> document. My
> first intuition was to create an XSL variable, and then send the
> transformer into a loop which concats each param tag onto 
> that variable.
> However, after reading the W3C doc, it doesn't seem like 
> that's feasible
> because you can't "shadow" a XSLT variable in the same 
> template context,
> and you can't reference the variable you're trying to declare in the
> variable definition.  TIA.
> 
> -Zack
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 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.