XSLT Function Runtime Error - Calling Querystring Value

Topics: General, Troubleshooting, XSLT
Jun 24, 2011 at 9:17 PM

Hi,

I need some help with a problem that I am running into on one website, but I can get it to work fine on others.  They are all the same version of the cms 2.1.3.  I listed out the details of my Function that are the same between a working site and this site that is giving me a Run Time Error.  When I go to the page and add the querystring to the end of the URL and I get an error page.  If I define the fallback to a value and not add the ?r=1 to the URL - The fallback value is displayed.   At first I thought I was missing a step, but I created the same exact function and it works on another website using the same version of composite.

Any help would be great,

Rob

 

I create a new XSLT function.

Add an Input Parameters:  Called "R"

  • Name and Label are both named R
  • Parameter Type = String
  • Default Value = "Composite.Web.Request.QueryStringValue
    • Parameter name: Constant value of R
    • FallBack: Default

Function Calls

  • Composite.Web.Request.QueryStringValue: QueryStringValue
    • Parameter Name: Input Parameter - value = R
    • FallBack Value: Default

 

Template

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:in="http://www.composite.net/ns/transformation/input/1.0" xmlns:lang="http://www.composite.net/ns/localization/1.0" xmlns:f="http://www.composite.net/ns/function/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl in lang f">
<xsl:template match="/">         

<xsl:param name="r" select="/in:inputs/in:param[@name='r']" />

 <html>

 <head></head>

<body>

<div> Value of input parameter <xsl:value-of select="r" /> </div>

  </body>

</html>

</xsl:template>
</xsl:stylesheet>

 

The Page that uses this function:

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head>

</head> 

<body>   

<f:function name="avc.test" xmlns:f="http://www.composite.net/ns/function/1.0">    </f:function> 

</body>

</html>

Coordinator
Jun 25, 2011 at 12:29 AM

This sound like a bug in the current beta - if your version is 2.1.3 you must be running of the latest source code - and not an official release?

You have provided excellent repro info, so it should be easy to fix.

You should stick to a stable release like 2.1.1 if you want to avoid situations like this - but thanks for helping us test the latest check-ins - we will try to fix this asap and publish the fix to keep you as a happy early adopter :)

Coordinator
Jun 27, 2011 at 9:03 AM
Edited Jun 27, 2011 at 9:13 AM

Well, it's not yet a fact that it is 2.1.3 specific. It works correctly on my machine.

>>  I listed out the details of my Function that are the same between a working site and this site that is giving me a Run Time Error.

Can you see anything in log files ~/App_Data/Composite/LogFiles/*.txt?

Developer
Jun 29, 2011 at 9:21 AM

Hi c2w,

  • You should use '$' when using the XSL variable. In your case it should be: select="$r"
  •  The name of the parameter is case-sensitive. If you define your input parameter as "R", you should use "R", when you "select" it for the XSL variable: select="/in:inputs/in:param[@name='R']

So you should have something like this:

<xsl:param name="r" select="/in:inputs/in:param[@name='R']" />
...
<xsl:value-of select="$r" />
  • In any case, it might be some bug with earlier 2.1.3 versions. Could you please tell me the exact build number so that I could see if there is a bug in that particular build and make sure that there is none in the further builds? (You can find it in the Administrative console: Help>About Composite C1 > Build no. .... (e.g. Build no. 2.1.4185.20987)

Thank you in advance

/Vitaly

 

Jul 1, 2011 at 5:03 AM

Thanks for all the help.  I have not yet tried to use your recommendation to use the "$".  I will look at this again tomorrow and let you know.  I listed the build number below.  Hope this helps.

Version: C1 2.1.3
Build no. 2.1.4191.29279
- Rob

Jul 1, 2011 at 2:53 PM

I actually had the $ in the correct spot, but just didn't show it in my post.  So my question is, how can I down-grade to a stable version without loosing the work I have already done.  (ie: my templates, pages, and xslt functions.)

Coordinator
Jul 1, 2011 at 5:52 PM

>> So my question is, how can I down-grade to a stable version without loosing the work I have already done.  (ie: my templates, pages, and xslt functions.)

Until we reproduced the bug, there's no guarantee that downgrading will solve the problem.  Can you send me a copy of your website, so I can do some debuggin' on Monday (my email is ddz at composite.net)?

Next week we will publish upgrade steps to a more stable version.

Developer
Jul 4, 2011 at 8:27 AM
c2w wrote:

... I listed the build number below.  Hope this helps.

 

Version: C1 2.1.3
Build no. 2.1.4191.29279
- Rob

 

Thank you, c2w.

At the moment, I can confirm that there is something wrong with QueryStringValue and the like functions - on 2.1.3 betas

(No problem on stable v2.1.1 - Build No. 2.1.4113.99).

The issue is reported and should be fixed in one of the following builds.

Sorry for inconveniences

/Vitaly