You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mike Gargiullo <mg...@smallworld.com> on 2000/07/11 21:17:05 UTC

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

try &#60; for <
and &#62; for >

thats what we use in our urls or mathmatics

-----Original Message-----
From: greg keraunen [mailto:gkeraunen@valinux.com]
Sent: Tuesday, July 11, 2000 2:38 PM
To: xalan-dev
Subject: can't output '>' from <xsl:call-template>; no problem from
<xsl:text>


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