You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2000/07/11 21:25:41 UTC

Re: can't output '>' from ; no problem from

Greg --

Adding the attribute 'disable-output-escaping="yes"' to the xsl:value-of
element did the trick in my testing.

Gary

greg keraunen wrote:
> 
> Friends,
> I am trying to output PHP code which sometimes includes the '>'
> character.
> 
> <xsl:template match="PROBLEM_CANT_OUPUT_CORRECTLY">
>         <xsl:call-template name="php">
>                 <xsl:with-param name="code">
>                         $this->messages_display();
>                 </xsl:with-param>
>         </xsl:call-template>
> </xsl:template>
> <xsl:template name="php">
>         <xsl:param name="code"/>
>         <xsl:text disable-output-escaping="yes">&lt;</xsl:text>?php
>         <xsl:value-of select="$code" />
>         <xsl:text disable-output-escaping="yes">?&gt;</xsl:text>
> </xsl:template>
> 
> The '>' in '$this->' gets translated internally to &gt; and my php
> template ouputs &gt; instead of '>' which causes the PHP interpreter to
> die.
> 
> This is not a problem if I don't use a named template and output the
> character as a final result, as in:
> 
> <xsl:text disable-output-escaping="yes">&lt;?php echo
> $this-&gt;messages_display(); ?&gt;</xsl:text>
> 
> In this case PHP sees '<?php echo $this->messages_display(); ?>', which
> is what I want  <xsl:template name="php"> to produce.
> 
> Any suggestions?
> Could I have my php template re-translate '&gt;' back into '$gt;'
> somehow (???)
> Or do I perhaps need to write an extension function for this kind
> of thing?
> 
> my system:
> VA Linux-supplied Red Hat 6.2
> jdk118_v1-glibc-2.1.2
> xalan-j_1_0_1
> 
> --
> greg keraunen <gk...@valinux.com> 408-542-8600 x8085
> web software engineer