You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brent Johnson <bl...@gmail.com> on 2004/12/09 18:24:03 UTC

XPath Functions in JXTemplate

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