#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    2
    Rep Power
    0

    Set parameter in URL


    Hi

    I am newbies in XSL..

    can anybody teach me how to set a parameter in XSL and send the parameter to URL...

    I want to set 1 parameter cput=3 and send to URL
    How to set this code in XSL = <input type="hidden" name="cput" value="3">

    Thanks in advanced
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Whee.

    Kinda vague question. Does your XSLT create HTML output? With a form? And you want to add that cput=? value?

    Depends where the value 3 is coming from: is it in the XML or are you pulling it from another source? If the former then use XSLT to add it - if you need help then post the XML (whole thing, please) and XSLT (snippets are okay).

    If the latter then use whatever programming language to pass in parameters to the XSLT processor - if you need help with that then we need to know what language you're using.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    Whee.

    Kinda vague question. Does your XSLT create HTML output? With a form? And you want to add that cput=? value?

    Depends where the value 3 is coming from: is it in the XML or are you pulling it from another source? If the former then use XSLT to add it - if you need help then post the XML (whole thing, please) and XSLT (snippets are okay).

    If the latter then use whatever programming language to pass in parameters to the XSLT processor - if you need help with that then we need to know what language you're using.
    Thanks for your responded.

    actually I have 1 template using XSLT. I don't have any XML file. The existing code XSLT will create HTML output.

    I need to modified this XSLT code by added the parameter cput=3 in the URL. Below is the existing parameter that pass to URL.

    Code:
    <!-- *** form_params: parameters carried by the search input form *** -->
    <xsl:template name="form_params">
      <xsl:for-each
        select="PARAM[@name != 'q' and
                      @name != 'ie' and
                      not(contains(@name, 'as_')) and
                      @name != 'btnG' and
                      @name != 'btnI' and
                      @name != 'site' and
                      @name != 'filter' and
                      @name != 'swrnum' and
                      @name != 'start' and
                      @name != 'access' and
                      @name != 'ip' and
                      @name != 'dnavs' and
                      (@name != 'epoch' or $is_test_search != '') and
                      not(starts-with(@name ,'metabased_'))]">
            <input type="hidden" name="{@name}" value="{@value}" />

    can we straight away create the value in this XSLT code and pass it to URL..??? So sorry.. not really know how it's works...
  6. #4
  7. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    The for-each is operating on some PARAM node set. Add a
    Code:
    <PARAM name="cput" value="3" />
    to whatever.

IMN logo majestic logo threadwatch logo seochat tools logo