You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stuart Roebuck <st...@adolos.co.uk> on 2002/02/21 18:47:30 UTC

Current CVS: bug?

I've just updated to the latest CVS and I notice that it has slightly 
changed the way <xsp:expr> is used.

> <xsp:expr>produceString()</xsp:expr><xsp:expr>produceAnotherString()</xsp:
> expr>

used to produce Java code:

> String.valueOf( (produceString()) + (produceAnotherString()) )

now it produces:

> String.valueOf( produceString() + produceAnotherString() )

which is fine in this case, but causes problems in cases like:

> <xsp:expr></xsp:expr>"String"<xsp:expr>(variable == true) ? "true" : 
> "false"</xsp:expr>

which becomes:

> String.valueOf( "String" + (variable == true) ? "true" : "false" )

and results in a "Incompatible type for ?:. Can't convert java.lang.String 
to boolean" compile error.

the workaround is to bracket the contents of <xsp:expr /> blocks, but this 
is unintuitive.

Stuart.

            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, etc.
ADOLOS                                           <http://www.adolos.com/>


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