Topic
  • 3 replies
  • Latest Post - ‏2012-04-30T15:08:13Z by HermannSW
msmps
msmps
193 Posts

Pinned topic illegal character

‏2012-04-30T13:46:48Z |
Trying to do HTTP Post through xsl

<xsl:variable name="urlcontent" select="'http://x.y.z/access/code?USER_NAME=abc123&PASSWORD=123456&REQUEST_RESP=true&CONSUMER_NAME=consumerXYZ
'"/>
        
<xsl:variable name="urlencode" select="dp:encode($urlcontent,'url')"/>
         
<xsl:variable name="routing-url" select="$url-encode"/>
        
 
<xsl:variable name="url-response">
   <dp:url-open  target="{$routing-url}" content-type="application/x-www-form-urlencoded"
       response="xml">
   </dp:url-open>
</xsl:variable>


But the logs keep on giving the following error which references to urlcontent line.

xslt: Request failed to compile. local:///PostCall.xsl: illegal character '=' at line 25 of local:///PostCall.xsl This is referenced by local:///PostCall.xsl.
Updated on 2014-03-25T02:57:23Z at 2014-03-25T02:57:23Z by iron-man
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: illegal character

    ‏2012-04-30T14:17:24Z  
    Try this:

    <xsl:variable name="urlcontent">http://x.y.z/access/code?USER_NAME=abc123&PASSWORD=123456&REQUEST_RESP=true&CONSUMER_NAME=consumerXYZ</xsl:variable>
    
    Updated on 2014-03-25T02:57:26Z at 2014-03-25T02:57:26Z by iron-man
  • msmps
    msmps
    193 Posts

    Re: illegal character

    ‏2012-04-30T14:39:34Z  
    Try this:

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr"><xsl:variable name="urlcontent">http://x.y.z/access/code?USER_NAME=abc123&PASSWORD=123456&REQUEST_RESP=true&CONSUMER_NAME=consumerXYZ</xsl:variable> </pre>
    no that didn't work either.
    but I changed & to %26 and it worked.

    But because of that the backend is not detecting. Is there any way that we can make it happen with the same url that i Posted
  • HermannSW
    HermannSW
    4903 Posts

    Re: illegal character

    ‏2012-04-30T15:08:13Z  
    • msmps
    • ‏2012-04-30T14:39:34Z
    no that didn't work either.
    but I changed & to %26 and it worked.

    But because of that the backend is not detecting. Is there any way that we can make it happen with the same url that i Posted
    Hi,

    your 1st posting's listing probably may have changed your URL string.
    You must have "...&​amp;..." inside a string, not "...&...".

    And you have a typo!
    You put the url-decoded value into variable $urlencode, but use the undefined variable $url-encode to define $routing-url ..

     
    Hermann<myXsltBlog/> <myXsltTweets/>