Search

Hello,
I'm trying to generate a dynamic css rule within the page, such as

<xsl:text>
  body {
    background-image: url('uploads/<xsl:value-of select="data/detail/entry/sfondo/filename"/>');
  }
</xsl:text>

But to no avail. Raises some error ("xslt:text content problem")... Thanks!

Your <xsl:value-of... isn't text, so you need to close off the xsl:text element.

Try this instead: <![CDATA=[ body { background-image: url('uploads/]]><![CDATA=['); } ]]>

Well, that broke the forums... please ignore that post Manaus!

Edit: Try this instead: http://pastebin.com/baGsanMN

<style>
  body {
    background-image: url("uploads/<xsl:value-of select='data/detail/entry/sfondo/filename'/>");
  }
</style>

Try invert the quotes. I use this way and works... Also there's no need of <xsl:text> for this approach.

Your first version is how I do it, but you need to terminate an restart the xsl:text before and after (respectively) the xsl:value-of

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