1 15 package org.apache.tapestry.script; 16 17 import org.apache.tapestry.util.xml.RuleDirectedParser; 18 import org.xml.sax.Attributes ; 19 20 30 class ForeachRule extends AbstractTokenRule 31 { 32 33 public void endElement(RuleDirectedParser parser) 34 { 35 parser.pop(); 36 } 37 38 public void startElement(RuleDirectedParser parser, Attributes attributes) 39 { 40 String key = getAttribute(attributes, "key"); 41 String index = getAttribute(attributes, "index"); 42 String expression = getAttribute(attributes, "expression"); 43 44 if (expression == null) 45 expression = getAttribute(attributes, "property-path"); 47 IScriptToken token = new ForeachToken(key, index, expression, parser.getLocation()); 48 49 addToParent(parser, token); 50 51 parser.push(token); 52 } 53 54 } 55 | Popular Tags |