7 users online. Create an account or sign in to join them.Users
XSLT and selecting ' character - solved
This is an open discussion with 5 replies, filed under XSLT.
Search
Off the top of my head… did you try '?
@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
&#39;
really works as expected? The debug I obtain on the page looks like
DEBUG'
and the debug in XHTML looks like
<b>DEBUG&#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">'</xsl:with-param> ... </xsl:call-template>
Problem solved.
Create an account or sign in to comment.
Hello.
I ran into a strange problem. While beying run from console using
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="'''" /><!-- 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
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…