Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2006, 11:45 AM
Authorized User
 
Join Date: Mar 2006
Location: Milwaukee, WI, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default What's wrong with this code?

<xsl:choose>
  <xsl:when test="contains($full_url, '?')">
<xsl:value-of select="$full_url"/>&amp;WT.gmini=true&amp;WT.apsearch=<xsl:value-of disable-output-escaping="yes" select="$html_escaped_query"/><xsl:text disable-output-escaping="yes">&amp;WT.searchclick=product_image&q uot;&gt;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$full_url"/>?WT.gmini=true&amp;WT.apsearch=<xsl:value-of disable-output-escaping="yes" select="$html_escaped_query"/><xsl:text disable-output-escaping="yes">&amp;WT.searchclick=product_image&q uot;&gt;</xsl:text>
</xsl:otherwise>
</xsl:choose>

Well, actually I know the problem is the ? in the second line because if I change that to some other text that appears in the full_url then it works fine. Why can't I search for a ? in a url? Or how do I do it properly?

Thanks.

Al Dugan
www.atomicpark.com
__________________
Al Dugan
www.atomicpark.com
Reply With Quote
  #2 (permalink)  
Old May 19th, 2006, 11:51 AM
Authorized User
 
Join Date: Mar 2006
Location: Milwaukee, WI, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nevermind...

%3F instead of the ? works

Al Dugan
www.atomicpark.com
Reply With Quote
  #3 (permalink)  
Old May 19th, 2006, 11:53 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I was going to say "What's wrong with this code is that it uses disable-output-escaping" - as that's often a symptom of poor XSLT programming. However, there's nothing wrong with the contains($x, '?') expression. Either your assumptions are wrong, and you're testing the wrong condition, or your processor has a bug. Given that you haven't actually provided any *evidence* that it's not working (you've only asserted the fact) my initial assumption would be that the error is in part of the code that you haven't shown us.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #4 (permalink)  
Old May 19th, 2006, 12:06 PM
Authorized User
 
Join Date: Mar 2006
Location: Milwaukee, WI, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know, I know.. I've been scolded here before for having ugly "disable-output-escaping" code... but this is not my fault, it's for the Google Mini search appliance and that is how all of their code is written... I'm simply working with what I've got.

Al Dugan
www.atomicpark.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what's wrong with my code? DyerOppenheimer BOOK: Beginning Ajax with ASP.NET 0 January 7th, 2008 08:46 AM
What's wrong with this code? appleseed C++ Programming 2 November 25th, 2006 08:17 AM
What is wrong with code? rtr1900 Classic ASP Databases 1 April 3rd, 2006 03:20 AM
What is wrong with this code? SaharaWizard VB Databases Basics 2 January 28th, 2006 08:20 AM
what's wrong with this code? miguel.ossa ASP.NET 1.0 and 1.1 Basics 2 January 21st, 2004 11:33 AM



All times are GMT -4. The time now is 06:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.