cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: XSP/Java - simple? problem
Date Wed, 11 Jun 2003 08:34:55 GMT
On 11.Jun.2003 -- 10:27 AM, Christian Haul wrote:
> On 11.Jun.2003 -- 08:43 AM, Derek Hohls wrote:
> >       <labels show="true">
> >       <xsp:attribute name="label"><xsp:expr>fGraphPtLabel</xsp:expr></xsp:attribute>
> >       <xsp:logic>
> >       if ((fGraphPtLabel != null) &amp;&amp; (fGraphPtLabel.equals("name")))
{              
> >         <xsp:attribute name="rotate">14</xsp:attribute>
> >       } else {
> >         <xsp:attribute name="rotate">1</xsp:attribute>
> >       }
> >       </xsp:logic> 

BTW (after looking at your followup including the generated code) you
could change the order to

    <labels show="true">
       <xsp:attribute name="label"><xsp:expr>fGraphPtLabel</xsp:expr></xsp:attribute>
       <xsp:logic>
           if ((fGraphPtLabel != null) &amp;&amp; (fGraphPtLabel.equals("name")))
{              
		      rotate = "14";
           } else {
              rotate = "1";
           }
       </xsp:logic> 
       <xsp:attribute name="rotate"><xsp:expr>rotate</xsp:expr></xsp:attribute>

I'm afraid that putting the logic into the xsp:attribute tag is not
possible unless it is a java expression like

    <labels show="true">
       <xsp:attribute name="label"><xsp:expr>fGraphPtLabel</xsp:expr></xsp:attribute>
       <xsp:attribute name="rotate"><xsp:expr>(
          (fGraphPtLabel != null) &amp;&amp;
		  (fGraphPtLabel.equals("name")) ? "14" : "1")
          </xsp:expr></xsp:attribute>

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
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