[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: white space to + in query string
You might want to check for more than just spaces, as e.g. non-ASCII characters (accented letters, for example) also need to be escaped. I hit the problem when I was generating GET queries based on the contents of database fields, e.g. : <a href="search.asp&name={@name}"> click here to search for <xsl:value-of select="@name" /> </a> I did not want to take any chances so I just defined an extension function that called Server.URLEncode - but of course there must be other means... Cheers, --Jonathan ----- Original Message ----- From: "Wendell Piez" <wapiez@xxxxxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, February 13, 2002 4:32 PM Subject: Re: white space to + in query string > If you're really paranoid (I should get extra Eudora hot peppers for saying > that -- huh, no....), you might want to normalize space before you do the > translate, to avoid extra "+" signs in your href: > > <a href="{translate(normalize-space(@some_attribute,' ','+'))}"> > > Cheers, > Wendell XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|