<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>guides/index.xml</filename>
    </added>
    <added>
      <filename>images/docbook.png</filename>
    </added>
    <added>
      <filename>images/lightlogo.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -13,7 +13,7 @@ IC_VERSIONS = 4.6.0 4.8.0 5.0.0 5.2.0 cvs-head
 #############################################################
 # Base definitions
 SYMBOL_TYPES= pragmas vars tags confs filters
-GUIDES      = iccattut programming-style upgrade faq
+GUIDES      = iccattut programming-style upgrade faq index
 HOWTOS      = howtos
 GLOSSARY    = glossary
 ALL_DOCS    = $(GLOSSARY) $(HOWTOS) $(GUIDES) $(SYMBOL_TYPES)
@@ -122,7 +122,7 @@ $T/%-c.db: %.xml
 #############################################################
 # STANDARD TARGETS || two-pass processing method
 #OUTPUT/howtos.html: DEPTH = &quot;--stringparam toc.max.depth 1&quot;
-OUTPUT/%.html: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent
+OUTPUT/%.html: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent docbook/icfiles.ent
 	echo &quot;C     $@&quot;
 	$(PSR) $(PSR_FLAGS)                                                \
 	  $(PROFILE)                                                       \
@@ -134,7 +134,7 @@ OUTPUT/%.html: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autoh
 	  --stringparam current.docid $*                                   \
 	  --stringparam target.database.document ../docbook/olinkdb-nc.xml \
 	  -o $@ docbook/html-nochunks.xsl $T/$*-nc.profiled
-OUTPUT/%: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent
+OUTPUT/%: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent docbook/icfiles.ent
 	echo &quot;C     $@/&quot;
 	$(PSR) $(PSR_FLAGS)                                                \
 	  $(PROFILE)                                                       \
@@ -146,7 +146,7 @@ OUTPUT/%: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos
 	  --stringparam current.docid $*                                   \
 	  --stringparam target.database.document ../docbook/olinkdb-nc.xml \
 	  -o $@/ docbook/html-chunks.xsl $T/$*-c.profiled
-OUTPUT/%.man: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent
+OUTPUT/%.man: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent docbook/icfiles.ent
 	echo &quot;C     $@/&quot;
 	mkdir -p &quot;$@&quot;
 	$(PSR) $(PSR_FLAGS)                                                \
@@ -167,8 +167,8 @@ OUTPUT/%.man: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autoho
 
 
 #############################################################
-# Supporting tagret - FO output
-tmp/%.latex: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent
+# Supporting target - LATEX output
+tmp/%.latex: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohowtos.ent docbook/icfiles.ent
 	$(PSR) $(PSR_FLAGS)                                                \
 	  $(PROFILE)                                                       \
 	  --stringparam current.docid $*                                   \
@@ -185,13 +185,6 @@ tmp/%.latex: %.xml docbook/autorefs.ent docbook/autoglossary.ent docbook/autohow
 	  --stringparam appendix.autolabel 0                               \
 	  --stringparam section.autolabel 0                                \
 	  -o $T/$*.latex docbook/latex.xsl $T/$*-nc.profiled
-#
-#
-#   --stringparam  passivetex.extensions  1
-#       --stringparam  rootid  &quot;using&quot; 
-#
-
-
 
 
 #############################################################
@@ -263,6 +256,7 @@ glossary/glossary.xml docbook/autoglossary.ent: $(shell find glossary/ -regex '.
 howtos/howtos.xml docbook/autohowtos.ent: $(shell find howtos/ -regex '.+[^(\.xml)]$$') bin/generic-autogen
 	bin/generic-autogen howtos
 docbook/autorefs.ent: refxmls
+docbook/icfiles.ent: refxmls
 
 
 ## Helper target, only used by docelic</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -89,6 +89,8 @@ my %longname = (
 	var =&gt; &quot;Global and catalog variable&quot;,
 );
 
+# Translation from granular internal types to 
+# XML output tag names.
 my %tagname = (
 	globvar =&gt; &quot;varname&quot;,
 	catvar =&gt; &quot;varname&quot;,
@@ -125,8 +127,8 @@ my %defaults = (
 
 my @mandatory = (qw/synopsis example description purpose/);
 
-# General section intros and &quot;outros&quot;; they are set per-item and not
-# only per-section as you could achieve with putting them in a template.
+# General section intros and &quot;outros&quot;; this header repeats per-item,
+# unlike the effect of using templates which are just one per-section.
 # The header is inserted
 # *after* &lt;title&gt;, if title was specified in section definition.
 my %item_header = (
@@ -212,27 +214,31 @@ while ( $path = shift @paths) { # For each version specified
 	}
 
 	# Load in list of files. It's prepared for us by bin/stattree.
-	open IN, &quot;&lt; tmp/$i{ver}.filelist&quot; or
-		die &quot;Can't rdopen 'tmp/$i{ver}.filelist' ($!)\n&quot;;
-	my @filelist = &lt;IN&gt;;
+	open IN, &quot;&lt; tmp/$i{ver}.MANIFEST&quot; or
+		die &quot;Can't rdopen 'tmp/$i{ver}.MANIFEST' ($!).\n&quot; .
+			&quot;Run 'make clean-cache cache'?\n&quot;;
+	my @MANIFEST = &lt;IN&gt;;
 	close IN;
-	chomp for @filelist;
+	chomp for @MANIFEST;
 	# DocBook doesn't like '%' in entitity content, so let's
 	# just weed out pages having %20 in the name
-	@filelist = grep {!/%/} @filelist;
-	my @filelist_ent = @filelist;
-	s/\//_/g for @filelist_ent;
+	@MANIFEST = grep {!/%/} @MANIFEST;
+	# The following line deals with /^MANIFEST/ line in MANIFEST file
+	s/\s.*// for @MANIFEST;
+	
+	my @MANIFEST_ent = @MANIFEST;
+	s/\//_/g for @MANIFEST_ent;
 
-	for (my $i=0; $i&lt;@filelist_ent;$i++) {
-		$_ = $filelist_ent[$i];
+	for (my $i=0; $i&lt;@MANIFEST_ent;$i++) {
+		$_ = $MANIFEST_ent[$i];
 
 		print FILE_ENTITIES
 			'&lt;!ENTITY cvsfile' .
 			$i{series} . '-' .
 			$_ .
 			qq{ &quot;&lt;ulink url='http://www.icdevgroup.org/cgi-bin/cvsweb/interchange/} .
-			$filelist[$i] . $i{cvstag} . &quot;'&gt;&quot; .
-			$filelist[$i] . qq{&lt;/ulink&gt;&quot;} . &quot;&gt;\n&quot;;
+			$MANIFEST[$i] . $i{cvstag} . &quot;'&gt;&quot; .
+			$MANIFEST[$i] . qq{&lt;/ulink&gt;&quot;} . &quot;&gt;\n&quot;;
 
 		# If this is the last version we generate docs for, also provide
 		# entity with no version in its name:
@@ -242,8 +248,8 @@ while ( $path = shift @paths) { # For each version specified
 				'-' . # Just $i{series} removed from here.
 				$_ .
 				qq{ &quot;&lt;ulink url='http://www.icdevgroup.org/cgi-bin/cvsweb/interchange/}.
-				$filelist[$i] . $i{cvstag} . &quot;'&gt;&quot; .
-				$filelist[$i] . qq{&lt;/ulink&gt;&quot;} . &quot;&gt;\n&quot;;
+				$MANIFEST[$i] . $i{cvstag} . &quot;'&gt;&quot; .
+				$MANIFEST[$i] . qq{&lt;/ulink&gt;&quot;} . &quot;&gt;\n&quot;;
 		}
 	}
 </diff>
      <filename>bin/refs-autogen</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,6 @@ my $ctx_n = 4; #                                after
 my %resolver_path; # Support for stack (a -&gt; b -&gt; c -&gt; d   =&gt;
                    # a = d with full &quot;path&quot; recorded). This expands
                    # MapRoutines, parse_ functions and things like that.
-my ($filelist,@filelist); # Keep and dump list of all files found
 
 # All file types should be listed here or the stats wont be accurate.
 # It should be reported if an unknown file is found in the archive (you can 
@@ -133,6 +132,12 @@ find({
 	bydepth =&gt; 0,
 	no_chdir=&gt; 1,
 }, &quot;.&quot;);
+
+
+# Copy MANIFEST to &quot;cache&quot;:
+`cp MANIFEST &quot;../../tmp/$i{ver}.MANIFEST&quot;`;
+print &quot;GEN: tmp/$i{ver}.MANIFEST\n&quot;;
+
 chdir $cpath; # Return to starting location
 
 
@@ -147,13 +152,6 @@ if ( $verbose ) {
 	close OUT;
 }
 
-# Dump out file list
-local $&quot; = &quot;\n&quot;;
-open OUT, &quot;&gt; tmp/$i{ver}.filelist&quot; or
-	die &quot;Can't open tmp/$i{ver}.filelist ($!)\n&quot;;
-print OUT &quot;@filelist&quot;;
-close OUT;
-
 exit 0;
 
 #################################################################
@@ -162,8 +160,6 @@ sub wanted {
 	( my $file = $_ ) =~ s/^\.\///;
 	return if $file eq '.';
 
-	push @filelist, $file;
-
 	# Things we ignore
 	return if /(^|\/)(CVS|\.cvs|\.svn|\.autoload)(\/.+[^\/])?$/;
 	</diff>
      <filename>bin/stattree</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,19 @@
 	&lt;xsl:param name=&quot;use.extensions&quot;&gt;0&lt;/xsl:param&gt;
 	&lt;xsl:param name=&quot;textinsert.extension&quot;&gt;1&lt;/xsl:param&gt;
 
+	&lt;!--
+		Define which document types get which ToC elements generated.
+		We only use article and reference doctypes in xmldocs.
+		Book.
+	--&gt;
+	&lt;xsl:param name=&quot;generate.toc&quot;&gt;
+		article    toc,title,figure,table,example,equation
+		reference  toc,title,example
+		book       nop
+		glossary   toc,title
+	&lt;/xsl:param&gt;
+
+
 	&lt;!--&lt;xsl:template match=&quot;tag&quot;&gt;&lt;xsl:text&gt;[&lt;/xsl:text&gt;&lt;xsl:call-template name=&quot;inline.monoseq&quot;/&gt;&lt;xsl:text&gt;]&lt;/xsl:text&gt;&lt;/xsl:template&gt;--&gt;
 	&lt;xsl:template match=&quot;tag&quot;&gt;[&lt;xsl:call-template name=&quot;inline.monoseq&quot;/&gt;]&lt;/xsl:template&gt;
 	&lt;xsl:template match=&quot;pragma&quot;&gt;&lt;xsl:call-template name=&quot;inline.monoseq&quot;/&gt;&lt;/xsl:template&gt;</diff>
      <filename>docbook/common.xsl</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,12 @@
 
   &lt;xsl:template name=&quot;user.footer.content&quot; &gt;
   &lt;p class='w3c'&gt;
+    &lt;a href=&quot;http://www.docbook.org/&quot;&gt;
+      &lt;img
+        src=&quot;../images/docbook.png&quot;
+        alt=&quot;DocBook!&quot;
+        class='w3cimg'/&gt;
+    &lt;/a&gt;
     &lt;a href=&quot;http://jigsaw.w3.org/css-validator/&quot;&gt;
       &lt;img
         src=&quot;../images/colophon_css.png&quot;</diff>
      <filename>docbook/html-chunks.xsl</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,12 @@
 	&lt;!-- till we use catalog for this --&gt;
   &lt;xsl:template name=&quot;user.footer.content&quot; &gt;
   &lt;p class='w3c'&gt;
+    &lt;a href=&quot;http://www.docbook.org/&quot;&gt;
+      &lt;img
+        src=&quot;images/docbook.png&quot;
+        alt=&quot;DocBook!&quot;
+        class='w3cimg'/&gt;
+    &lt;/a&gt;
     &lt;a href=&quot;http://jigsaw.w3.org/css-validator/&quot;&gt;
       &lt;img
         src=&quot;images/colophon_css.png&quot;</diff>
      <filename>docbook/html-nochunks.xsl</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@
 	&lt;!ENTITY upgrade SYSTEM &quot;../tmp/upgrade-c.db&quot;&gt; 
 	&lt;!ENTITY faq SYSTEM &quot;../tmp/faq-c.db&quot;&gt; 
 	&lt;!ENTITY programming-style SYSTEM &quot;../tmp/programming-style-c.db&quot;&gt; 
+	&lt;!ENTITY index SYSTEM &quot;../tmp/index-c.db&quot;&gt; 
 	&lt;!ENTITY howtos SYSTEM &quot;../tmp/howtos-c.db&quot;&gt; 
 	&lt;!ENTITY glossary SYSTEM &quot;../tmp/glossary-c.db&quot;&gt; 
 	&lt;!ENTITY pragmas SYSTEM &quot;../tmp/pragmas-c.db&quot;&gt; 
@@ -47,6 +48,12 @@
 				&lt;/document&gt;
 			&lt;/dir&gt;
 			
+			&lt;dir name='index'&gt;
+				&lt;document targetdoc=&quot;index&quot;&gt;
+				&amp;index;
+				&lt;/document&gt;
+			&lt;/dir&gt;
+			
 			&lt;dir name='howtos'&gt;
 				&lt;document targetdoc=&quot;howtos&quot;&gt;
 				&amp;howtos;</diff>
      <filename>docbook/olinkdb-c.xml</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@
 	&lt;!ENTITY upgrade SYSTEM &quot;../tmp/upgrade-nc.db&quot;&gt; 
 	&lt;!ENTITY faq SYSTEM &quot;../tmp/faq-nc.db&quot;&gt; 
 	&lt;!ENTITY programming-style SYSTEM &quot;../tmp/programming-style-nc.db&quot;&gt; 
+	&lt;!ENTITY index SYSTEM &quot;../tmp/index-nc.db&quot;&gt; 
 	&lt;!ENTITY howtos SYSTEM &quot;../tmp/howtos-nc.db&quot;&gt; 
 	&lt;!ENTITY glossary SYSTEM &quot;../tmp/glossary-nc.db&quot;&gt; 
 	&lt;!ENTITY pragmas SYSTEM &quot;../tmp/pragmas-nc.db&quot;&gt; 
@@ -26,6 +27,7 @@
 			&lt;document targetdoc=&quot;upgrade&quot; baseuri=&quot;upgrade.html&quot;&gt; &amp;upgrade; &lt;/document&gt;
 			&lt;document targetdoc=&quot;faq&quot; baseuri=&quot;faq.html&quot;&gt; &amp;faq; &lt;/document&gt;
 			&lt;document targetdoc=&quot;programming-style&quot; baseuri=&quot;programming-style.html&quot;&gt; &amp;programming-style; &lt;/document&gt;
+			&lt;document targetdoc=&quot;index&quot; baseuri=&quot;index.html&quot;&gt; &amp;index; &lt;/document&gt;
 			&lt;document targetdoc=&quot;howtos&quot; baseuri=&quot;howtos.html&quot;&gt; &amp;howtos; &lt;/document&gt;
 			&lt;document targetdoc=&quot;glossary&quot; baseuri=&quot;glossary.html&quot;&gt; &amp;glossary; &lt;/document&gt;
 			&lt;document targetdoc=&quot;pragmas&quot; baseuri=&quot;pragmas.html&quot;&gt; &amp;pragmas; &lt;/document&gt;</diff>
      <filename>docbook/olinkdb-nc.xml</filename>
    </modified>
    <modified>
      <diff>@@ -330,6 +330,32 @@ thead {
 }
 
 /*
+	Book element styling. Only used for first index page
+	that links to other pages.
+*/
+
+.book thead {
+	background-color: #be7109;
+}
+
+
+.book td, .book table {
+	border: none;
+}
+
+.book th {
+	border: 1px dashed #fff;
+}
+
+.book table a {
+	font-size: 70%;
+}
+
+.book .authorgroup {
+	background: url(images/lightlogo.png) no-repeat scroll center right;
+}
+
+/*
 	Glossary styling:
 
 	.glossary .titlepage . . h2.title &lt;a/&gt; /h2 / / . / / </diff>
      <filename>docbook/xmldocs.css</filename>
    </modified>
    <modified>
      <diff>@@ -1974,7 +1974,6 @@ with user-entered data.
 &lt;/para&gt;
 &lt;/answer&gt;&lt;/qandaentry&gt;
 
-&lt;!--
 &lt;qandaentry&gt;
 	&lt;question&gt;&lt;para&gt;Optimizing lists&lt;/para&gt;&lt;/question&gt;
 &lt;answer&gt;&lt;para&gt;
@@ -2009,19 +2008,18 @@ up complex lists by orders of magnitude.
 &lt;/para&gt;&lt;para&gt;
 
 Benchmarking
+&lt;/para&gt;&lt;para&gt;
 
 A non-precise benchmark of different iteration options can be done
-with the following global UserTag. Place this in a file in the
-usertag/ directory in the &amp;IC; root:
+with the following &amp;glos-ITL; tag. Place this in a file in the
+&lt;filename class='directory'&gt;usertag/&lt;/filename&gt;
+directory in the &amp;IC; root:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
-]]&gt;&lt;/programlisting&gt;
-
 UserTag benchmark Order start display
 UserTag benchmark AddAttr
-UserTag benchmark Routine &lt;&lt;eor
+UserTag benchmark Routine &lt;&lt;EOR
 my $bench_start;
 my @bench_times;
 sub {
@@ -2052,67 +2050,55 @@ sub {
     return;
 }
 EOR
+]]&gt;&lt;/programlisting&gt;
 
 Then at the beginning of the code to check, call
 
-
 &lt;programlisting&gt;&lt;![CDATA[
-
+[benchmark start=1]
 ]]&gt;&lt;/programlisting&gt;
 
-        [benchmark start=1]
-
 to start the measurement. At the end
 
-
 &lt;programlisting&gt;&lt;![CDATA[
-
+[benchmark]
 ]]&gt;&lt;/programlisting&gt;
 
-        [benchmark]
-
 will display the time used. Bear in mind that it is not precise, and
 that there may be variation due to system conditions. Also, the longer
 the times and the bigger the list, the better the comparison.
 
 To see the system/user breakdown, do:
 
-
 &lt;programlisting&gt;&lt;![CDATA[
-
+[benchmark verbose=1]
 ]]&gt;&lt;/programlisting&gt;
 
-        [benchmark verbose=1]
-
 In general, &quot;user&quot; time measures &amp;IC; processing time and and
 the rest are indicative of the database access overhead, which can vary
 widely from database to database.
+&lt;/para&gt;&lt;para&gt;
 
-H3: Optimizations
+Optimizations
 
 * [PREFIX-tag] is faster than [parsed-tag]
 
 
 &lt;programlisting&gt;&lt;![CDATA[
+[loop prefix=foo search=&quot;ra=yes&quot;]
 
-]]&gt;&lt;/programlisting&gt;
+  [foo-data products image] is slightly faster than
+  [foo-field image] which is MUCH faster than
+  [data products image [foo-code]] which is faster than
+  [data table=products column=image key=&quot;[foo-code]&quot;]
 
-    [loop prefix=foo search=&quot;ra=yes&quot;]
-
-        [foo-data products image]
-                is slightly faster than
-        [foo-field image]
-                which is MUCH faster than
-        [data products image [foo-code]]
-                which is faster than
-        [data table=products column=image key=&quot;[foo-code]&quot;]
-
-    [/loop]
+[/loop]
+]]&gt;&lt;/programlisting&gt;
 
 The loop tags are interpreted by means of fast regular expression
 scans of the loop container text, and fetch an entire row of
-data in one query. The [data ...]  ITL tag interpretation is
-delayed until after the loop is finished, whereby the ITL tag
+data in one query. The &amp;tag-data; ITL tag interpretation is
+delayed until after the loop is finished, whereby the &amp;glos-ITL; tag
 parser must find the tag, build a parameter list, then fetch the
 data with a separate query. If there are repeated references to
 the same field in the loop, the speedup can be 10x or more.
@@ -2130,18 +2116,17 @@ The following are equivalent:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
+Benchmark loop-field list: [benchmark start=1]
+  &lt;!-- [loop search=&quot;ra=yes/st=db&quot;]
+       [loop-code] price: [loop-field price] [/loop] --&gt;
+       TIME: [benchmark]
+
+Benchmark loop-param list: [benchmark start=1]
+  &lt;!-- [loop search=&quot;ra=yes/st=db/rf=sku,price&quot;]
+       [loop-code] price: [loop-param price] [/loop] --&gt;
+       TIME: [benchmark]
 ]]&gt;&lt;/programlisting&gt;
 
-        Benchmark loop-field list: [benchmark start=1]
-        &lt;!- [loop search=&quot;ra=yes/st=db&quot;]
-                [loop-code] price: [loop-field price] [/loop] -&gt;
-        TIME: [benchmark]
-
-        Benchmark loop-param list: [benchmark start=1]
-        &lt;!- [loop search=&quot;ra=yes/st=db/rf=sku,price&quot;]
-                [loop-code] price: [loop-param price] [/loop] -&gt;
-        TIME: [benchmark]
 
 but the second is much, much faster.
 
@@ -2152,53 +2137,50 @@ row or data containers. I see a lot of:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
+[loop search=&quot;ra=yes&quot;]
+  [calc] return '&lt;tr&gt;' if [loop-increment] == 1; return[/calc]
+  [calc] return '' if [loop-increment] % 3; return '&lt;/tr&gt;' [/calc]
+[/loop]
 ]]&gt;&lt;/programlisting&gt;
 
-        [loop search=&quot;ra=yes&quot;]
-        [calc] return '&lt;tr&gt;' if [loop-increment] == 1; return[/calc]
-        [calc] return '' if [loop-increment] % 3; return '&lt;/TR&gt;' [/calc]
-        [/loop]
 
 Much faster, by a few orders of magnitude, is:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
+[loop search=&quot;ra=yes&quot;]
+  [loop-change 1][condition]1[/condition]&lt;tr&gt;[/loop-change 1]
+  [loop-alternate 3]&lt;/TR&gt;[/loop-alternate]
+[/loop]
 
-]]&gt;&lt;/programlisting&gt;
-
-        [loop search=&quot;ra=yes&quot;]
-        [loop-change 1][condition]1[/condition]&lt;tr&gt;[/loop-change 1]
-        [loop-alternate 3]&lt;/TR&gt;[/loop-alternate]
-        [/loop]
-
-        If you think you need to close the final row by checking the
-        final count, look at this:
-
-        [loop search=&quot;ra=yes&quot;]
-        [on-match]
-                &lt;table&gt;
-                &lt;tr&gt;
-        [/on-match]
-
-        [list]
-                        &lt;td&gt;[loop-code]&lt;/TD&gt;
-                [loop-alternate 3]&lt;/TR&gt;&lt;tr&gt;[/loop-alternate]
-        [/list]
-
-        [on-match]
-                &lt;/TR&gt;
-                &lt;/TABLE&gt;
-        [/on-match]
-
-        [no-match]
-                No match, sorry.
-        [/no-match]
+If you think you need to close the final row by checking the
+final count, look at this:
 
+[loop search=&quot;ra=yes&quot;]
+  [on-match]
+    &lt;table&gt;
+    &lt;tr&gt;
+  [/on-match]
+  
+  [list]
+    &lt;td&gt;[loop-code]&lt;/TD&gt;
+    [loop-alternate 3]&lt;/TR&gt;&lt;tr&gt;[/loop-alternate]
+  [/list]
+  
+  [on-match]
+    &lt;/tr&gt;
+    &lt;/table&gt;
+  [/on-match]
+  
+  [no-match]
+    No match, sorry.
+  [/no-match]
 [/loop]
+]]&gt;&lt;/programlisting&gt;
+
 
 This is a hundred times faster than anything you can build with
-multiple [calc] tags.
+multiple &amp;tag-calc; tags.
 
 * Use simple go/nogo comparisons in [if ...]
 
@@ -2206,20 +2188,15 @@ Consider these two snippets:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
+[if scratch|value|cgi key] THEN [/if]
 ]]&gt;&lt;/programlisting&gt;
 
-        [if scratch|value|cgi key] THEN [/if]
-
 and:
 
-
 &lt;programlisting&gt;&lt;![CDATA[
-
+[if scratch|value|cgi key == '1'] THEN [/if]
 ]]&gt;&lt;/programlisting&gt;
 
-        [if scratch|value|cgi key == '1'] THEN [/if]
-
 The first one doesn't require &amp;PERL; evaluation. It simply checks to see
 if the value is blank or 0, and returns true if it is anything but.
 Of course this requires setting your test values to blank or 0 instead
@@ -2227,56 +2204,57 @@ of &quot;No&quot; or &quot; &quot; or somesuch, but it is anywhere from 20-35% faster.
 
 Try it on the foundation demo:
 
-
 &lt;programlisting&gt;&lt;![CDATA[
+Overhead: 
+
+[benchmark start=1]
+
+&lt;!--
+[loop search=&quot;ra=yes&quot;]
+  [set cert][loop-field gift_cert][/set]
+[/loop]
+--&gt;
+
+[benchmark]
+&lt;p&gt;
 
-]]&gt;&lt;/programlisting&gt;
 
-    - begin test -
-
-    Overhead: 
-    [benchmark start=1]
-        &lt;!- [loop search=&quot;ra=yes&quot;]
-                    [set cert][loop-field gift_cert][/set]
-            [/loop] -&gt;
-    [benchmark]
-    &lt;p&gt;
-
-
-    if scratch compare: 
-    [benchmark start=1]
-        &lt;!-
-        [loop search=&quot;ra=yes&quot;]
-        [set cert][loop-field gift_cert][/set]
-        [loop-code] [if scratch cert] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert] YES [else] NO [/else][/if]
-        [/loop]
-        -&gt;
-
-    [benchmark]
-    &lt;p&gt;
-
-    if scratch compare eq 1: 
-    [benchmark start=1]
-        &lt;!-
-        [loop search=&quot;ra=yes&quot;]
-        [set cert][loop-field gift_cert][/set]
-        [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
-        [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
-        [/loop]
-        -&gt;
-    [benchmark]
-    &lt;p&gt;
-
-    [page @@MV_PAGE@@]Again&lt;/a&gt;
-
-    - end test -
+if scratch compare: 
+[benchmark start=1]
+
+&lt;!--
+[loop search=&quot;ra=yes&quot;]
+  [set cert][loop-field gift_cert][/set]
+  [loop-code] [if scratch cert] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert] YES [else] NO [/else][/if]
+[/loop]
+--&gt;
+
+[benchmark]
+&lt;p&gt;
+
+
+if scratch compare eq 1: 
+[benchmark start=1]
+&lt;!--
+[loop search=&quot;ra=yes&quot;]
+  [set cert][loop-field gift_cert][/set]
+  [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
+  [loop-code] [if scratch cert == 1] YES [else] NO [/else][/if]
+[/loop]
+--&gt;
+
+[benchmark]
+&lt;p&gt;
+
+[page @@MV_PAGE@@]Again&lt;/a&gt;
+]]&gt;&lt;/programlisting&gt;
 
 * Use [PREFIX-calc] instead of [calc] or [perl]
 
@@ -2293,25 +2271,23 @@ available for access inside of it, just do:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
+[perl tables=&quot;products pricing&quot;] [/perl]
 ]]&gt;&lt;/programlisting&gt;
 
-        [perl tables=&quot;products pricing&quot;] [/perl]
 
 prior to list start. Now you can do something like:
 
 
 &lt;programlisting&gt;&lt;![CDATA[
-
+[loop search=&quot;ra=yes&quot;]
+  [loop-calc]
+    $desc = $Tag-&gt;data('products', 'description', '[loop-code]');
+    $link = $Tag-&gt;page('[loop-code]');
+    return &quot;$link $desc &lt;/A&gt;&quot;;
+  [/loop-calc] &lt;br&gt;
+[/loop]
 ]]&gt;&lt;/programlisting&gt;
 
-    [loop search=&quot;ra=yes&quot;]
-        [loop-calc]
-            $desc = $Tag-&gt;data('products', 'description', '[loop-code]');
-            $link = $Tag-&gt;page('[loop-code]');
-            return &quot;$link $desc &lt;/A&gt;&quot;;
-        [/loop-calc] &lt;br&gt;
-    [/loop]
 
 * ADVANCED: Precompile and execute with [PREFIX-sub] and [PREFIX-exec]
 
@@ -2333,37 +2309,37 @@ faster than separate [PREFIX-calc] calls.
 
 
 &lt;programlisting&gt;&lt;![CDATA[
+[benchmark start=1]
+
+loop-calc:
+&lt;!--
+[loop search=&quot;st=db/fi=country/ra=yes/ml=1000&quot;]
+  [loop-calc]
+    my $code = q{[loop-code]};
+    return &quot;code '$code' reversed is &quot; . reverse($code);
+  [/loop-calc]
+[/loop]
+--&gt;
+
+[benchmark]
+
+&lt;p&gt;
+
+[benchmark start=1]
+loop-sub and loop-exec:
+&lt;!--
+[loop search=&quot;st=db/fi=country/ra=yes/ml=1000&quot;]
+  [loop-sub country_compare]
+    my $code = shift;
+    return &quot;code '$code' reversed is &quot; . reverse($code);
+  [/loop-sub]
+  [loop-exec country_compare][loop-code][/loop-exec]
+[/loop]
+--&gt;
 
+[benchmark]
 ]]&gt;&lt;/programlisting&gt;
 
-    [benchmark start=1]
-    loop-calc:
-      &lt;!-
-            [loop search=&quot;st=db/fi=country/ra=yes/ml=1000&quot;]
-            [loop-calc]
-                    my $code = q{[loop-code]};
-                    return &quot;code '$code' reversed is &quot; . reverse($code);
-            [/loop-calc]
-            [/loop]
-      -&gt;
-                    
-    [benchmark]
-
-    &lt;p&gt;
-
-    [benchmark start=1]
-    loop-sub and loop-exec:
-      &lt;!-
-            [loop search=&quot;st=db/fi=country/ra=yes/ml=1000&quot;]
-            [loop-sub country_compare]
-                    my $code = shift;
-                    return &quot;code '$code' reversed is &quot; . reverse($code);
-            [/loop-sub]
-            [loop-exec country_compare][loop-code][/loop-exec]
-            [/loop]
-      -&gt;
-                    
-    [benchmark]
 
 * ADVANCED: Execute and save with [query ...], then use an embedded &amp;PERL;
 routine.
@@ -2379,50 +2355,54 @@ This is the fastest possible method to display a list.
 
 
 &lt;programlisting&gt;&lt;![CDATA[
+[set waiting_for]os28004[/set]
 
-]]&gt;&lt;/programlisting&gt;
+[benchmark start=1] Embedded &amp;PERL;
+&lt;!--
+[query arrayref=myref sql=&quot;select sku,price,description from products&quot; /]
 
-  - begin test code -
-  [set waiting_for]os28004[/set]
-  
-  [benchmark start=1] Embedded &amp;PERL;
-  &lt;!-
-  [query arrayref=myref sql=&quot;select sku,price,description from products&quot;]
-        &lt;!- make query, this container text is not used. -&gt;
-  [/query]
-  
-  [perl]
-    # Get the query results, has multiple fields
-    my $ary = $Tmp-&gt;{myref};
-    my $out = '';
-    foreach $line (@$ary) {
-        my ($sku, $price, $desc) = @$line;
-        if($sku eq $Scratch-&gt;{waiting_for}) {
-                $out .= &quot;We were waiting for this one!!!!\n&quot;;
-        }
-        $out .= &quot;sku: $sku price: $price description: $desc\n&quot;;
+[perl]
+  # Get the query results, has multiple fields
+  my $ary = $Tmp-&gt;{myref};
+  my $out = '';
+
+  foreach $line (@$ary) {
+    my ($sku, $price, $desc) = @$line;
+    if($sku eq $Scratch-&gt;{waiting_for}) {
+      $out .= &quot;We were waiting for this one!!!!\n&quot;;
     }
-    return $out;
-  [/perl]
-  -&gt;
-  TIME: [benchmark]
-  
-  [benchmark start=1] All loop
-  &lt;!-
-  [query list=1 sql=&quot;select sku,price,description from products&quot;]
-        [if scratch waiting_for eq '[sql-code]']
-            We were waiting for this one!!!!
-        [/if]
-        sku: [sql-code]
-        price: [sql-param price]
-        desc: [sql-param description]  
-  [/query]
-  -&gt;
-  
-  TIME: [benchmark]
+    $out .= &quot;sku: $sku price: $price description: $desc\n&quot;;
+  }
+  return $out;
+[/perl]
+--&gt;
+
+TIME: [benchmark]
+
+
+[benchmark start=1] All loop
+
+&lt;!--
+[query list=1 sql=&quot;select sku,price,description from products&quot;]
+
+  [if scratch waiting_for eq '[sql-code]']
+    We were waiting for this one!!!!
+  [/if]
   
-  - end test code -
+  sku: [sql-code]
+  price: [sql-param price]
+  desc: [sql-param description]  
+[/query]
+--&gt;
+
+TIME: [benchmark]
+]]&gt;&lt;/programlisting&gt;
+&lt;/para&gt;
+&lt;/answer&gt;
+&lt;/qandaentry&gt;
+
 
+&lt;!--
 * Other things that help:
 
 ** Avoid interpolate=1 when possible. A separate tag parser must be spawned</diff>
      <filename>guides/faq.xml</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 __NAME__ purpose
-backup Interchange databases, optionally 
+backup Interchange databases, even rows selectively
 __END__
 
 __NAME__ synopsis </diff>
      <filename>refs/backup-database.tag</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ __NAME__ online: Filter example
 [set online_commify_test]1234567890.123456[/set]
 
 My commified value, trimed to 2 decimal places is:
-[filter commify.2]online_commify_test[/filter]
+[filter commify.2][scratchd online_commify_test][/filter]
 &lt;/programlisting&gt;
 __END__
 </diff>
      <filename>refs/commify.filter</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>65794f3ef63a76ec59e62f7b1c68e06b24e09788</id>
    </parent>
  </parents>
  <author>
    <name>Davor Ocelic</name>
    <email>docelic@spinlocksolutions.com</email>
  </author>
  <url>http://github.com/interchange/xmldocs/commit/a8653bb0aede739ad76ac94926874406aa4dec93</url>
  <id>a8653bb0aede739ad76ac94926874406aa4dec93</id>
  <committed-date>2005-09-01T16:12:38-07:00</committed-date>
  <authored-date>2005-09-01T16:12:38-07:00</authored-date>
  <message>

** Incompatible changes to bin/stattree and bin/refs-autogen force you to do:
   make clean-cache caches   (to regenerate cache files)

** Besides other changes that follow, I have added the index page that links
   to other documents.
   This index page is necessary for the alpha release of xmldocs along with
   the new website.
	 Update CVS, then do   make OUTPUT/index.html  , it's beautiful!


- bin/stattree:
 - instead of going for the trouble of discovering distribution files ourselves,
   just copy the MANIFEST file
 - dump file is tmp/&lt;version&gt;.MANIFEST and not tmp/&lt;version&gt;.filelist any more

- bin/refs-autogen:
 - same code as before but renamed .filelist to .MANIFEST
 - small comments added / clarified
 - improve one error message (suggest solution)

- docbook/xmldocs.css: add CSS for index page
- docbook/html-*.xsl: added docbook icon to documents' footer
- docbook/*: rest of supporting elements, as always

- images/lightlogo.png: small bright variant of IC logo for decoration
- images/docbook.png: docbook icon

- Makefile:
 - add document 'index' to list of docs to generate
 - add docbook/icfiles.ent to list of dependencies
 - remove comment that we don't need any more

- refs/*: simple fixes
- guides/faq.xml: further rearrangements and xml-ification</message>
  <tree>b18492b702093e79c2cdba706f4017b0870d7540</tree>
  <committer>
    <name>Davor Ocelic</name>
    <email>docelic@spinlocksolutions.com</email>
  </committer>
</commit>
