7 users online. Create an account or sign in to join them.Users

Search

Hello.

I ran into a strange problem. While beying run from console using

xsltproc

everything goes just fine, when run from Symphony strange error occures as shown below:

      Compile
          XSLTProcessor::importStylesheet(): Invalid expression
          XSLTProcessor::importStylesheet(): XSLT-with-param:
              Failed to compile select expression '''''

Weird.

Here’s the corresponding code generating the error:

   <xsl:template name="translate-single-quotes">
      <xsl:param name="text" select="''" />
      <xsl:call-template name="translate-surrounding">
         <xsl:with-param name="text" select="$text" />
         <xsl:with-param name="mark" select="'&#39;'" /><!-- HERE -->
         <xsl:with-param name="opening"
            select="/data/punctuation/entry/single-opening-quote" />
         <xsl:with-param name="closing"
            select="/data/punctuation/entry/single-closing-quote" />
      </xsl:call-template>
   </xsl:template>

Any ideas? The same situation may be with the

&quot;

character…

I need to solve it because I need to replace ill ASCII quotes to their corresponding HTML entities for given language with proper spacing (especially in French language) etc…

Off the top of my head… did you try &#38;#39;?

@phoque: Nice idea! At least it supressed the error. Now I need to find out whether it really solved the problem. Thanks for now…

@phoque: If I only knew to call the template on all p, a, li etc. elements produced. I tried

<xsl:template match="//p|//a|//li">
   <xsl:call-template ...
</xsl:template>

But it does not seem to apply at all…

And also, the

//

is so slow, because it walks the whole tree… Any standard way to cope with it?

@phoque: Hm. I matched even the “*” and put some

<b><xsl:text>DEBUG</xsl:text><xsl:value-of select="$text" /></b>

inside the most inner template and it seems to apply but the quotation marks are not replaced. Are you sure your expression

&#38;#39;

really works as expected? The debug I obtain on the page looks like

DEBUG&#39;

and the debug in XHTML looks like

<b>DEBUG&amp;#39;</b>

Should it look like that? It should be expanded, right? Otherwise, I guess, the select can not work.

@phoque: too easy :D

<xsl:call-template ...
   <xsl:with-param name="mark">&#39;</xsl:with-param>
   ...
</xsl:call-template>

Problem solved.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details