You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2003/06/11 10:55:14 UTC

[FIXED] Re: XSP/Java - simple? problem

Brilliant, thanks Chris.

To summarise, this:

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

should be:

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


>>> haul@dvs1.informatik.tu-darmstadt.de 11/06/2003 10:34:55 >>>
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 



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org