|  XmlParser Template execute()
 
            Re-execute part of an XML tag tree. Each note gets to re-evaluate its contribution to the document
            being generated. ADVANCED.
           Syntax void = rb.XmlParser.execute(parameters)  Parameters The 'execute' method takes 1 parameter: 
 | Name | Type/Value | Range/Length | Description |  | parameters | MetaData |  | Optional. JavaScript parameters to be passed to the tagtree. These appear as global JavaScript variables to any
		        JavaScript executed within the tag-tree. |  
  Results The 'execute' method returns no useful information.  Remarks  This method uses the Whitebeam Presentation Engine to 
             re-execute the source XML of the tag tree. Invoking this method will discard the current 
		       text output of the tag tree and rerun the entire 
		       subtree. In the case where the tag tree simply contains static HTML - this will generate the 
		       same text. Where the tree contains active Whitebeam server-side code however that code will 
             be re-executed using the current executing environment. So for example the JavaScript within 
				 the tree could have access to different parameters. The tag tree re-executed may include content that executes JavaScript - either directly
				 through things like the <rb:script...> or <rb:eval...> tags, or indirectly 
             because the content includes a tag for which there is a macro tag definition - an <rb:macrotag...>.
				 In these situations it can be useful to pass some parameters into the tagtree. Consider the very simple
				 example:    <rb:block rb:id="myBlock"><tr>
 <td>
 <rb:eval expr="name"/>
 </td>
 <td>
 <rb:eval expr="dataset[name]"/>
 </td>
 </tr>
 </rb:block>
 
 <rb:script>
 var data = ["this", "is", "the", "dataset"];
 var tags = rb.page.tagtree("myBlock");
 
 for var (count=0;count<data.length;count++) {
 tags.regenerate();
 rb.page.writr(tags.bodytext());
 }
 </rb:script>
 
 In this case we want to repeat the block a number of times - each time the
            code generates a different table row. The example won't work because the contents
				of the tagtree is always executed in the global context. To make this work you
				have to pass the parameters into the execution. Re-writing the script yields the
				correct behaviour:    <rb:script>var data = ["this", "is", "the", "dataset"];
 var tags = rb.page.tagtree("myBlock");
 
 for var (count=0;count<data.length;count++) {
 tags.regenerate({count:count, dataset:data});
 rb.page.writr(tags.bodytext());
 }
 </rb:script>
 
 'regenerate' now has a single parameter - an object that is initialised to contain two
				attributes, 'count' and 'dataset'. This object is placed at the front of the JavaScript
				scope chain before executing the XML subtree. |