cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paint...@mc.duke.edu
Subject Re: Can not add xsp:expr to xsl:attribute
Date Thu, 07 Jun 2001 18:58:02 GMT

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 cocoon-users@xml.apache.org

To:   <cocoon-users@xml.apache.org>
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message