Search

Well, it's been a very long time since I have been here, but I am very stuck. This is something I know I used to be able to do, but it's been a while.

I need to get the query-string from /data/params/current-query-string and use it in a url, as a query-string.

<a href="{$root}/?{$current-query-string}">link</a>

is giving me

<a href="blah.com/?<![CDATA[location=burnley]]>">link</a>

Now, either I'm missing something, or there is a bug. I know it was me that wrapped the query-string in CDATA in the first place, but as I say, it's been a very long time.

How do I use the value as plain text again?

Hi, you can try like that

<xsl:variable name="query">  
  <xsl:copy> 
    <xsl:value-of select="/data/params/current-query-string/." disable-output-escaping="yes"/>
  </xsl:copy>
</xsl:variable>


<a href="blah.com/?{$query}"> link </a>
<a href="{/data/params/root}/?{/data/params/current-query-string}">link</a>

Thanks guys. It looks like the CDATA section is being escaped, as it is escaped text in the output.

Jens, that is what I'm currently doing in reality, as I am redeclaring the parameter from the params xml.

Vincent, I've tried this to no avail...

Something pretty wacky is happening here :(

So, it looks like my version of Symphony has an error with $current-query-string where it contains escaped CDATA.

Actually using /data/params/current-query-string in place works perfectly. If I try and make a variable out of it, it creates escaped CDATA.

Weird.

Me too using v2.6.7, current query is wrapped into cdata.
Strange, it worked for me...

xml alt text

Template
alt text

Result (the query in debug view is debug=result ^^, but it worked also in for any query without debug)
alt text

So, it looks like my version of Symphony has an error with $current-query-string where it contains escaped CDATA.

No, that is the way it should be.

Actually using /data/params/current-query-string in place works perfectly.

Yes, it should work! CDATA just means that this is character data.

If I try and make a variable out of it, it creates escaped CDATA.

This is the strange part indeed. And I can not confirm that this ever happens. If it does for you, it is probably not a bug in Symphony but in your XSLT PHP module. I suggest to test on a different server.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details