Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Spaces in param

  1. #1
    okjones is offline Member
    Join Date
    Aug 2011
    Location
    Oklahoma
    Posts
    31

    Default Spaces in param

    I'm trying to use an xml package on the product page that pulls up items in a series, but I can't seem to pass on the param to my custom xml package. ProductID works, but ProdGroupName doesn't. Note that the value of ProdGroupName does contain spaces. Is that why it doesn't pass thru correctly?

    Code:
    <xsl:value-of select="aspdnsf:XmlPackage('seriesproducts.xml.config' , concat('ProductID=',ProductID,'SeriesName=',ProdGroupName))" disable-output-escaping="yes" />
    Here's the query from the custom xml package...

    Code:
        <query name="SeriesItems" rowElementName="Item">
            <sql>
                <![CDATA[
    			SELECT    * 
    			FROM         dbo.SeriesProducts PS WITH(NOLOCK) 
    			WHERE		PS.CUSTCHAR21 = @SeriesName AND PS.ProductID <> @ProductID
                ]]>
            </sql>
            <queryparam paramname="@SeriesName"    paramtype="runtime"   requestparamname="SeriesName"  sqlDataType="nvarchar" defvalue=""		validationpattern=""  />
    		<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
    	</query>
    I know the query and package both work because when I type in a default value for SeriesName, it executes correctly.

  2. #2
    okjones is offline Member
    Join Date
    Aug 2011
    Location
    Oklahoma
    Posts
    31

    Default Spaces not the issue

    I've discovered that the issue is that the parameter is wrapped in xml tags. However, when I put the following under the template match=product

    Code:
    <xsl:param name="SeriesName" select="aspdnsf:GetMLValue(/root/CustFields/Field/CUSTCHAR21)"/></xsl:param>
    the page won't display. If I put it above the templates, the page will display, but the param is not passed correctly to the xml package.

    Any ideas?

  3. #3
    okjones is offline Member
    Join Date
    Aug 2011
    Location
    Oklahoma
    Posts
    31

    Default Fixed

    Fixed. There were several things wrong with the approach--one was the paramtype used on the query.