My favorites | Sign in
Project Logo
                
Search
for
Updated May 02, 2008 by b.goodspeed
LookaheadExample  
An example of lookahead on execute statements

Lookahead

Lookahead allows rcor to reference a concordion variable before its definition. The definition must be in a tag nested inside the enclosing tag containing the reference.

In rcor lookahead is only implemented for concordion:execute commands, and only looks ahead for nested concordion:set commands.

The following example demonstrates how lookahead can be useful to interpret "unusual sentence structures". The html is copied verbatim from the java concordion tutorial.

nested_element_lookahead.html

<html xmlns:concordion="http://www.concordion.org/2007/concordion">
<body>
<p concordion:execute="#greeting = greetingFor(#firstName)">
    The greeting "<span concordion:assertEquals="#greeting">Hello Bob!</span>"
    should be given to user <span concordion:set="#firstName">Bob</span>
    when he logs in.
</p>
</body>
</html>

nested_element_lookahead_test.rb

class NestedElementLookaheadTest < ConcordionTestCase
  def greetingFor(name)
    "Hello #{name}!"
  end
end

Caveats

Note that this is not the preferred way to instrument tables. Table instrumentation is copied from headers into row elements.


Comment by poornima.dgl, Jul 08, 2008

hello..

I want to know about this..what is rcor?..bez i didn't get the full view of

rcor yet..please give me some more examples to know about this..

With regards, Poornima.D


Sign in to add a comment
Hosted by Google Code