cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Johnson <bljohn...@gmail.com>
Subject XPath Functions in JXTemplate
Date Thu, 09 Dec 2004 17:24:03 GMT
Can I use XPath functions in a JXTemplate?  I'm trying now.. but the
XPath query always returns false.  Here's my example:

<jx:choose>
<jx:when test="starts-with('${colors.get(block.getColor())}','/')">
IMAGE
</jx:when>
<jx:otherwise>
NOT IMAGE
</jx:otherwise>
</jx:choose>

I'm running this in a jx:forEach on a list of items that have
different color values.  The variable
"${colors.get(block.getColor())}" is returning either a color
(#FFFFFF) or an image value (/some/directory/image.gif).

I'm just trying to test whether the first character of the return
value starts with a "/" or a "#".

Thanks,

- Brent

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


Mime
View raw message