cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <>
Subject Re: xsp in stylesheet isn't being exectued
Date Fri, 16 Mar 2001 08:59:29 GMT
Try this:
<xsl:value-of select="{$testit})"/>
You have to put params and variables into { and } when using in
attribute values.
    Konstantin Piroumian.

----- Original Message ----- 
From: Vorbau, Alex <>  
To: '' <mailto:''>

Sent: Friday, March 16, 2001 4:38 AM
Subject: xsp in stylesheet isn't being exectued

I'm trying to include a small bit of java XSP code in my stylesheet so I
can URL-encode a variable, but the XSP code isn't executing.  BTW, I've
already tried this:
<xsl:value-of select="$testit)"/>
But the value it returns is blank.  Putting $testit in quotes encodes
the literal string into %24testit, instead of the contents of the
variable.  Ideas around this would be helpful too.
Following the XSP examples that come with cocoon, I came up with this
XSP code.  What am I doing wrong?  It seems to be ignoring the xsp: tags
and output the java code.  The resulting page is this:
This should be url-encoded: "you&me" ) 
But it's not! 

<?xml version="1.0"?> 
<?cocoon-process type="xsp" ?>
<?cocoon-process type="xslt" ?>
<?xml-stylesheet href="xsptest.xsl" type="text/xsl"?>
<xsp:page language="java"
  This should be url-encoded:<br/> <encode-this string="you&amp;me"/>
  But it's not!

 This works, but I want to do this in the .xsl file:<br/>
 <xsp:expr> "frankie&amp;johnny" )

<?xml version="1.0" ?>
   xmlns:xsl="" version="1.0" >
<xsl:variable name="testit">tony&amp;Alba's!!</xsl:variable>
<xsl:template match="xsp:page">
 <xsp:page xmlns:xsp="">
    <xsl:copy>     <xsl:apply-templates/>    </xsl:copy>
<xsl:template match="page">
<html><body>     <xsl:apply-templates/></body></html>

<xsl:template match="encode-this">
 <xsp:expr> "<xsl:value-of select="@string" />" )
<!-- passes through the html content -->
<xsl:template match="@*|node()" priority="-1">
  <xsl:apply-templates select="@*|node()"/>

Alex Vorbau
HP Labs, Internet & Mobile Systems Lab
650-857-3050 <> 


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message