Yes! This requires the (unreleased) Velocity 1.5. You'll need to download the nightly snapshot if you're not using it.

Here's the new operators:

'and', 'or', 'lt', 'gt', 'le', 'ge', 'eq'.

WILL

----- Original Message ----- From: "Robert Koberg" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>
Sent: Thursday, August 25, 2005 12:45 PM
Subject: Re: Velocity Markup


Will Glass-Husain wrote:
Incidentally, my XML editor complains about this as well (invalid <
character). I checked the Velocity source and found out that there are alternate operands such as "lt". Nice!


Ufff... Now I have some content to go and edit :) Is there something for '&&'? -- greater-than '>' is OK for for XML.


I have been using templates in XSL to handle it (I know, uuggghh). I have used the template/@match when it is in the source (#if ($foo <d:and/> $bar)...) and template/@name when it is in the XSL (#if ($foo <xsl:call-template name="dynamic_and"/> $bar)...):

<!-- this is a hack!!! -->
  <xsl:template name="d:and">
    <xsl:call-template name="dynamic_and"/>
  </xsl:template>
  <xsl:template name="dynamic_and">
    <xsl:text disable-output-escaping="yes">&amp;&amp;</xsl:text>
  </xsl:template>
  <!--
  -->
  <xsl:template match="d:less-than">
    <xsl:call-template name="dynamic_less-than"/>
  </xsl:template>
  <xsl:template name="dynamic_less-than">
    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
  </xsl:template>
  <!--
  -->

best,
-Rob



<Worksheet ss:Name="Data" ss:Protected="1">

#if($cols < $mincols)
   #set($cols = $mincols)
#end

<Table ss:ExpandedColumnCount="$cols" ss:ExpandedRowCount="$rowcount">
etc.

WILL


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to