Simone,
you are mixing XSP and XSL. It isn't clear to me what your XPath
expressions (in your <xsl:value-of> element) are operating on, as there
shouldn't be any input XML if you are writing an XSP program. XSP
generates XML that can then be acted on by XSL or other processors. The
only time it makes sense to mix XSP and XSL like this is when you are
writing a logicsheet, but your XPath expressions don't really make sense
for that, either. You probably need to think about separating out these
two parts. E.g., write your XSP something like this:
...
<xsp:logic>
if(viewer.isPie()) {
<xsp:content>
<viewer-is-pie>
<get-unavailable><xsp:expr>viewer.getUnavailable</xsp:expr></get-unavailable>
</viewer-is-pie>
</xsp:content>
}
</xsp:logic>
then write a separate stylesheet, something like
<xsl:template match="viewer-is-pie">
<tr><td>
<img>
<xsl:attribute name="src"><xsl:value-of select="..."/><xsl:value-of
select="get-unavailable"/></xsl:attribute>
</img>
</td></tr>
</xsl:template>
-Christopher
Please respond to [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
cc:
Subject: Can not add xsp:expr to xsl:attribute
Hi all, is there a way to jump across the following problem?
1)
<xsp:logic>
if(viewer.isPie()){
<tr><td bgcolor="#ffffff" width="340" height="20" vlign="bottom" align
= "left" colspan = "2">
<img><xsl:attribute name = "src"> <xsl:value-of select
="../report_information/piechart/@path"/><xsp:expr>viewer.getUnavailable
()</xsp:expr>
</xsl:attribute></img>
</td></tr>
}
</xsp:logic>
2) Alternatively, I try to define a xsl variable and assign it with in
<xsl:variable name = "param" ><xsp:expr>viewer.getUnavailable
()</xsp:expr></xsl:variable>
<xsp:logic>
if(viewer.isPie()){
<tr><td bgcolor="#ffffff" width="340" height="20" vlign="bottom" align
= "left" colspan = "2">
<img><xsl:attribute name = "src"> <xsl:value-of select
="../report_information/piechart/@path"/><xsl:value-of select="{$param}">
</xsl:attribute></img>
</td></tr>
}
</xsp:logic>
but it return the variable's name end not its value.
Thank all in advance Simone.
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>