Get content form CDATA
This is an open discussion with 6 replies, filed under XSLT.
Search
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.
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.
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?