[docs] xmldocs - docelic modified 15 files

docs at icdevgroup.org docs at icdevgroup.org
Thu Sep 1 19:12:39 EDT 2005


User:      docelic
Date:      2005-09-01 23:12:39 GMT
Modified:  .        Makefile
Modified:  bin      refs-autogen stattree
Modified:  docbook  common.xsl html-chunks.xsl html-nochunks.xsl
Modified:           olinkdb-c.xml olinkdb-nc.xml xmldocs.css
Modified:  guides   faq.xml
Modified:  refs     backup-database.tag commify.filter
Added:     guides   index.xml
Added:     images   docbook.png lightlogo.png
Log:
** 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/<version>.MANIFEST and not tmp/<version>.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

Revision  Changes    Path
1.69      +7 -13     xmldocs/Makefile


rev 1.69, prev_rev 1.68
Index: Makefile
===================================================================
RCS file: /var/cvs/xmldocs/Makefile,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- Makefile	20 Aug 2005 13:16:28 -0000	1.68
+++ Makefile	1 Sep 2005 23:12:38 -0000	1.69
@@ -13,7 +13,7 @@
 #############################################################
 # 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 @@
 #############################################################
 # STANDARD TARGETS || two-pass processing method
 #OUTPUT/howtos.html: DEPTH = "--stringparam toc.max.depth 1"
-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 "C     $@"
 	$(PSR) $(PSR_FLAGS)                                                \
 	  $(PROFILE)                                                       \
@@ -134,7 +134,7 @@
 	  --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 "C     $@/"
 	$(PSR) $(PSR_FLAGS)                                                \
 	  $(PROFILE)                                                       \
@@ -146,7 +146,7 @@
 	  --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 "C     $@/"
 	mkdir -p "$@"
 	$(PSR) $(PSR_FLAGS)                                                \
@@ -167,8 +167,8 @@
 
 
 #############################################################
-# 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 @@
 	  --stringparam appendix.autolabel 0                               \
 	  --stringparam section.autolabel 0                                \
 	  -o $T/$*.latex docbook/latex.xsl $T/$*-nc.profiled
-#
-#
-#   --stringparam  passivetex.extensions  1
-#       --stringparam  rootid  "using" 
-#
-
-
 
 
 #############################################################
@@ -263,6 +256,7 @@
 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



1.93      +21 -15    xmldocs/bin/refs-autogen


rev 1.93, prev_rev 1.92
Index: refs-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/refs-autogen,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- refs-autogen	30 Aug 2005 21:43:30 -0000	1.92
+++ refs-autogen	1 Sep 2005 23:12:38 -0000	1.93
@@ -89,6 +89,8 @@
 	var => "Global and catalog variable",
 );
 
+# Translation from granular internal types to 
+# XML output tag names.
 my %tagname = (
 	globvar => "varname",
 	catvar => "varname",
@@ -125,8 +127,8 @@
 
 my @mandatory = (qw/synopsis example description purpose/);
 
-# General section intros and "outros"; they are set per-item and not
-# only per-section as you could achieve with putting them in a template.
+# General section intros and "outros"; this header repeats per-item,
+# unlike the effect of using templates which are just one per-section.
 # The header is inserted
 # *after* <title>, if title was specified in section definition.
 my %item_header = (
@@ -212,27 +214,31 @@
 	}
 
 	# Load in list of files. It's prepared for us by bin/stattree.
-	open IN, "< tmp/$i{ver}.filelist" or
-		die "Can't rdopen 'tmp/$i{ver}.filelist' ($!)\n";
-	my @filelist = <IN>;
+	open IN, "< tmp/$i{ver}.MANIFEST" or
+		die "Can't rdopen 'tmp/$i{ver}.MANIFEST' ($!).\n" .
+			"Run 'make clean-cache cache'?\n";
+	my @MANIFEST = <IN>;
 	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<@filelist_ent;$i++) {
-		$_ = $filelist_ent[$i];
+	for (my $i=0; $i<@MANIFEST_ent;$i++) {
+		$_ = $MANIFEST_ent[$i];
 
 		print FILE_ENTITIES
 			'<!ENTITY cvsfile' .
 			$i{series} . '-' .
 			$_ .
 			qq{ "<ulink url='http://www.icdevgroup.org/cgi-bin/cvsweb/interchange/} .
-			$filelist[$i] . $i{cvstag} . "'>" .
-			$filelist[$i] . qq{</ulink>"} . ">\n";
+			$MANIFEST[$i] . $i{cvstag} . "'>" .
+			$MANIFEST[$i] . qq{</ulink>"} . ">\n";
 
 		# If this is the last version we generate docs for, also provide
 		# entity with no version in its name:
@@ -242,8 +248,8 @@
 				'-' . # Just $i{series} removed from here.
 				$_ .
 				qq{ "<ulink url='http://www.icdevgroup.org/cgi-bin/cvsweb/interchange/}.
-				$filelist[$i] . $i{cvstag} . "'>" .
-				$filelist[$i] . qq{</ulink>"} . ">\n";
+				$MANIFEST[$i] . $i{cvstag} . "'>" .
+				$MANIFEST[$i] . qq{</ulink>"} . ">\n";
 		}
 	}
 



1.44      +6 -10     xmldocs/bin/stattree


rev 1.44, prev_rev 1.43
Index: stattree
===================================================================
RCS file: /var/cvs/xmldocs/bin/stattree,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- stattree	30 Aug 2005 20:00:23 -0000	1.43
+++ stattree	1 Sep 2005 23:12:38 -0000	1.44
@@ -40,7 +40,6 @@
 my %resolver_path; # Support for stack (a -> b -> c -> d   =>
                    # a = d with full "path" recorded). This expands
                    # MapRoutines, parse_ functions and things like that.
-my ($filelist, at 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 @@
 	bydepth => 0,
 	no_chdir=> 1,
 }, ".");
+
+
+# Copy MANIFEST to "cache":
+`cp MANIFEST "../../tmp/$i{ver}.MANIFEST"`;
+print "GEN: tmp/$i{ver}.MANIFEST\n";
+
 chdir $cpath; # Return to starting location
 
 
@@ -147,13 +152,6 @@
 	close OUT;
 }
 
-# Dump out file list
-local $" = "\n";
-open OUT, "> tmp/$i{ver}.filelist" or
-	die "Can't open tmp/$i{ver}.filelist ($!)\n";
-print OUT "@filelist";
-close OUT;
-
 exit 0;
 
 #################################################################
@@ -161,8 +159,6 @@
 sub wanted {
 	( my $file = $_ ) =~ s/^\.\///;
 	return if $file eq '.';
-
-	push @filelist, $file;
 
 	# Things we ignore
 	return if /(^|\/)(CVS|\.cvs|\.svn|\.autoload)(\/.+[^\/])?$/;



1.17      +13 -0     xmldocs/docbook/common.xsl


rev 1.17, prev_rev 1.16
Index: common.xsl
===================================================================
RCS file: /var/cvs/xmldocs/docbook/common.xsl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- common.xsl	22 Nov 2004 00:18:43 -0000	1.16
+++ common.xsl	1 Sep 2005 23:12:38 -0000	1.17
@@ -26,6 +26,19 @@
 	<xsl:param name="use.extensions">0</xsl:param>
 	<xsl:param name="textinsert.extension">1</xsl:param>
 
+	<!--
+		Define which document types get which ToC elements generated.
+		We only use article and reference doctypes in xmldocs.
+		Book.
+	-->
+	<xsl:param name="generate.toc">
+		article    toc,title,figure,table,example,equation
+		reference  toc,title,example
+		book       nop
+		glossary   toc,title
+	</xsl:param>
+
+
 	<!--<xsl:template match="tag"><xsl:text>[</xsl:text><xsl:call-template name="inline.monoseq"/><xsl:text>]</xsl:text></xsl:template>-->
 	<xsl:template match="tag">[<xsl:call-template name="inline.monoseq"/>]</xsl:template>
 	<xsl:template match="pragma"><xsl:call-template name="inline.monoseq"/></xsl:template>



1.12      +6 -0      xmldocs/docbook/html-chunks.xsl


rev 1.12, prev_rev 1.11
Index: html-chunks.xsl
===================================================================
RCS file: /var/cvs/xmldocs/docbook/html-chunks.xsl,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- html-chunks.xsl	27 Dec 2004 01:06:11 -0000	1.11
+++ html-chunks.xsl	1 Sep 2005 23:12:38 -0000	1.12
@@ -23,6 +23,12 @@
 
   <xsl:template name="user.footer.content" >
   <p class='w3c'>
+    <a href="http://www.docbook.org/">
+      <img
+        src="../images/docbook.png"
+        alt="DocBook!"
+        class='w3cimg'/>
+    </a>
     <a href="http://jigsaw.w3.org/css-validator/">
       <img
         src="../images/colophon_css.png"



1.7       +6 -0      xmldocs/docbook/html-nochunks.xsl


rev 1.7, prev_rev 1.6
Index: html-nochunks.xsl
===================================================================
RCS file: /var/cvs/xmldocs/docbook/html-nochunks.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- html-nochunks.xsl	27 Dec 2004 01:06:11 -0000	1.6
+++ html-nochunks.xsl	1 Sep 2005 23:12:38 -0000	1.7
@@ -11,6 +11,12 @@
 	<!-- till we use catalog for this -->
   <xsl:template name="user.footer.content" >
   <p class='w3c'>
+    <a href="http://www.docbook.org/">
+      <img
+        src="images/docbook.png"
+        alt="DocBook!"
+        class='w3cimg'/>
+    </a>
     <a href="http://jigsaw.w3.org/css-validator/">
       <img
         src="images/colophon_css.png"



1.14      +7 -0      xmldocs/docbook/olinkdb-c.xml


rev 1.14, prev_rev 1.13
Index: olinkdb-c.xml
===================================================================
RCS file: /var/cvs/xmldocs/docbook/olinkdb-c.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- olinkdb-c.xml	29 May 2005 15:05:05 -0000	1.13
+++ olinkdb-c.xml	1 Sep 2005 23:12:38 -0000	1.14
@@ -5,6 +5,7 @@
 	<!ENTITY upgrade SYSTEM "../tmp/upgrade-c.db"> 
 	<!ENTITY faq SYSTEM "../tmp/faq-c.db"> 
 	<!ENTITY programming-style SYSTEM "../tmp/programming-style-c.db"> 
+	<!ENTITY index SYSTEM "../tmp/index-c.db"> 
 	<!ENTITY howtos SYSTEM "../tmp/howtos-c.db"> 
 	<!ENTITY glossary SYSTEM "../tmp/glossary-c.db"> 
 	<!ENTITY pragmas SYSTEM "../tmp/pragmas-c.db"> 
@@ -44,6 +45,12 @@
 			<dir name='programming-style'>
 				<document targetdoc="programming-style">
 				&programming-style;
+				</document>
+			</dir>
+			
+			<dir name='index'>
+				<document targetdoc="index">
+				&index;
 				</document>
 			</dir>
 			



1.14      +2 -0      xmldocs/docbook/olinkdb-nc.xml


rev 1.14, prev_rev 1.13
Index: olinkdb-nc.xml
===================================================================
RCS file: /var/cvs/xmldocs/docbook/olinkdb-nc.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- olinkdb-nc.xml	29 May 2005 15:05:05 -0000	1.13
+++ olinkdb-nc.xml	1 Sep 2005 23:12:38 -0000	1.14
@@ -5,6 +5,7 @@
 	<!ENTITY upgrade SYSTEM "../tmp/upgrade-nc.db"> 
 	<!ENTITY faq SYSTEM "../tmp/faq-nc.db"> 
 	<!ENTITY programming-style SYSTEM "../tmp/programming-style-nc.db"> 
+	<!ENTITY index SYSTEM "../tmp/index-nc.db"> 
 	<!ENTITY howtos SYSTEM "../tmp/howtos-nc.db"> 
 	<!ENTITY glossary SYSTEM "../tmp/glossary-nc.db"> 
 	<!ENTITY pragmas SYSTEM "../tmp/pragmas-nc.db"> 
@@ -26,6 +27,7 @@
 			<document targetdoc="upgrade" baseuri="upgrade.html"> &upgrade; </document>
 			<document targetdoc="faq" baseuri="faq.html"> &faq; </document>
 			<document targetdoc="programming-style" baseuri="programming-style.html"> &programming-style; </document>
+			<document targetdoc="index" baseuri="index.html"> &index; </document>
 			<document targetdoc="howtos" baseuri="howtos.html"> &howtos; </document>
 			<document targetdoc="glossary" baseuri="glossary.html"> &glossary; </document>
 			<document targetdoc="pragmas" baseuri="pragmas.html"> &pragmas; </document>



1.21      +26 -0     xmldocs/docbook/xmldocs.css


rev 1.21, prev_rev 1.20
Index: xmldocs.css
===================================================================
RCS file: /var/cvs/xmldocs/docbook/xmldocs.css,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- xmldocs.css	3 Feb 2005 15:30:35 -0000	1.20
+++ xmldocs.css	1 Sep 2005 23:12:38 -0000	1.21
@@ -330,6 +330,32 @@
 }
 
 /*
+	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 <a/> /h2 / / . / / 



1.6       +187 -207  xmldocs/guides/faq.xml


rev 1.6, prev_rev 1.5
Index: faq.xml
===================================================================
RCS file: /var/cvs/xmldocs/guides/faq.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- faq.xml	12 Aug 2005 22:33:40 -0000	1.5
+++ faq.xml	1 Sep 2005 23:12:38 -0000	1.6
@@ -1974,7 +1974,6 @@
 </para>
 </answer></qandaentry>
 
-<!--
 <qandaentry>
 	<question><para>Optimizing lists</para></question>
 <answer><para>
@@ -2009,19 +2008,18 @@
 </para><para>
 
 Benchmarking
+</para><para>
 
 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 &IC; root:
+with the following &glos-ITL; tag. Place this in a file in the
+<filename class='directory'>usertag/</filename>
+directory in the &IC; root:
 
 
 <programlisting><![CDATA[
-
-]]></programlisting>
-
 UserTag benchmark Order start display
 UserTag benchmark AddAttr
-UserTag benchmark Routine <<eor
+UserTag benchmark Routine <<EOR
 my $bench_start;
 my @bench_times;
 sub {
@@ -2052,67 +2050,55 @@
     return;
 }
 EOR
+]]></programlisting>
 
 Then at the beginning of the code to check, call
 
-
 <programlisting><![CDATA[
-
+[benchmark start=1]
 ]]></programlisting>
 
-        [benchmark start=1]
-
 to start the measurement. At the end
 
-
 <programlisting><![CDATA[
-
+[benchmark]
 ]]></programlisting>
 
-        [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:
 
-
 <programlisting><![CDATA[
-
+[benchmark verbose=1]
 ]]></programlisting>
 
-        [benchmark verbose=1]
-
 In general, "user" time measures &IC; processing time and and
 the rest are indicative of the database access overhead, which can vary
 widely from database to database.
+</para><para>
 
-H3: Optimizations
+Optimizations
 
 * [PREFIX-tag] is faster than [parsed-tag]
 
 
 <programlisting><![CDATA[
+[loop prefix=foo search="ra=yes"]
 
-]]></programlisting>
-
-    [loop prefix=foo search="ra=yes"]
+  [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="[foo-code]"]
 
-        [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="[foo-code]"]
-
-    [/loop]
+[/loop]
+]]></programlisting>
 
 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 &tag-data; ITL tag interpretation is
+delayed until after the loop is finished, whereby the &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 @@
 
 
 <programlisting><![CDATA[
-
+Benchmark loop-field list: [benchmark start=1]
+  <!-- [loop search="ra=yes/st=db"]
+       [loop-code] price: [loop-field price] [/loop] -->
+       TIME: [benchmark]
+
+Benchmark loop-param list: [benchmark start=1]
+  <!-- [loop search="ra=yes/st=db/rf=sku,price"]
+       [loop-code] price: [loop-param price] [/loop] -->
+       TIME: [benchmark]
 ]]></programlisting>
 
-        Benchmark loop-field list: [benchmark start=1]
-        <!- [loop search="ra=yes/st=db"]
-                [loop-code] price: [loop-field price] [/loop] ->
-        TIME: [benchmark]
-
-        Benchmark loop-param list: [benchmark start=1]
-        <!- [loop search="ra=yes/st=db/rf=sku,price"]
-                [loop-code] price: [loop-param price] [/loop] ->
-        TIME: [benchmark]
 
 but the second is much, much faster.
 
@@ -2152,53 +2137,50 @@
 
 
 <programlisting><![CDATA[
-
+[loop search="ra=yes"]
+  [calc] return '<tr>' if [loop-increment] == 1; return[/calc]
+  [calc] return '' if [loop-increment] % 3; return '</tr>' [/calc]
+[/loop]
 ]]></programlisting>
 
-        [loop search="ra=yes"]
-        [calc] return '<tr>' if [loop-increment] == 1; return[/calc]
-        [calc] return '' if [loop-increment] % 3; return '</TR>' [/calc]
-        [/loop]
 
 Much faster, by a few orders of magnitude, is:
 
 
 <programlisting><![CDATA[
+[loop search="ra=yes"]
+  [loop-change 1][condition]1[/condition]<tr>[/loop-change 1]
+  [loop-alternate 3]</TR>[/loop-alternate]
+[/loop]
 
-]]></programlisting>
-
-        [loop search="ra=yes"]
-        [loop-change 1][condition]1[/condition]<tr>[/loop-change 1]
-        [loop-alternate 3]</TR>[/loop-alternate]
-        [/loop]
-
-        If you think you need to close the final row by checking the
-        final count, look at this:
-
-        [loop search="ra=yes"]
-        [on-match]
-                <table>
-                <tr>
-        [/on-match]
-
-        [list]
-                        <td>[loop-code]</TD>
-                [loop-alternate 3]</TR><tr>[/loop-alternate]
-        [/list]
-
-        [on-match]
-                </TR>
-                </TABLE>
-        [/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="ra=yes"]
+  [on-match]
+    <table>
+    <tr>
+  [/on-match]
+  
+  [list]
+    <td>[loop-code]</TD>
+    [loop-alternate 3]</TR><tr>[/loop-alternate]
+  [/list]
+  
+  [on-match]
+    </tr>
+    </table>
+  [/on-match]
+  
+  [no-match]
+    No match, sorry.
+  [/no-match]
 [/loop]
+]]></programlisting>
+
 
 This is a hundred times faster than anything you can build with
-multiple [calc] tags.
+multiple &tag-calc; tags.
 
 * Use simple go/nogo comparisons in [if ...]
 
@@ -2206,20 +2188,15 @@
 
 
 <programlisting><![CDATA[
-
+[if scratch|value|cgi key] THEN [/if]
 ]]></programlisting>
 
-        [if scratch|value|cgi key] THEN [/if]
-
 and:
 
-
 <programlisting><![CDATA[
-
+[if scratch|value|cgi key == '1'] THEN [/if]
 ]]></programlisting>
 
-        [if scratch|value|cgi key == '1'] THEN [/if]
-
 The first one doesn't require &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 @@
 
 Try it on the foundation demo:
 
-
 <programlisting><![CDATA[
+Overhead: 
 
-]]></programlisting>
+[benchmark start=1]
+
+<!--
+[loop search="ra=yes"]
+  [set cert][loop-field gift_cert][/set]
+[/loop]
+-->
+
+[benchmark]
+<p>
+
+
+if scratch compare: 
+[benchmark start=1]
+
+<!--
+[loop search="ra=yes"]
+  [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]
+-->
+
+[benchmark]
+<p>
 
-    - begin test -
 
-    Overhead: 
-    [benchmark start=1]
-        <!- [loop search="ra=yes"]
-                    [set cert][loop-field gift_cert][/set]
-            [/loop] ->
-    [benchmark]
-    <p>
-
-
-    if scratch compare: 
-    [benchmark start=1]
-        <!-
-        [loop search="ra=yes"]
-        [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]
-        ->
-
-    [benchmark]
-    <p>
-
-    if scratch compare eq 1: 
-    [benchmark start=1]
-        <!-
-        [loop search="ra=yes"]
-        [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]
-        ->
-    [benchmark]
-    <p>
+if scratch compare eq 1: 
+[benchmark start=1]
+<!--
+[loop search="ra=yes"]
+  [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]
+-->
 
-    [page @@MV_PAGE@@]Again</a>
+[benchmark]
+<p>
 
-    - end test -
+[page @@MV_PAGE@@]Again</a>
+]]></programlisting>
 
 * Use [PREFIX-calc] instead of [calc] or [perl]
 
@@ -2293,25 +2271,23 @@
 
 
 <programlisting><![CDATA[
-
+[perl tables="products pricing"] [/perl]
 ]]></programlisting>
 
-        [perl tables="products pricing"] [/perl]
 
 prior to list start. Now you can do something like:
 
 
 <programlisting><![CDATA[
-
+[loop search="ra=yes"]
+  [loop-calc]
+    $desc = $Tag->data('products', 'description', '[loop-code]');
+    $link = $Tag->page('[loop-code]');
+    return "$link $desc </A>";
+  [/loop-calc] <br>
+[/loop]
 ]]></programlisting>
 
-    [loop search="ra=yes"]
-        [loop-calc]
-            $desc = $Tag->data('products', 'description', '[loop-code]');
-            $link = $Tag->page('[loop-code]');
-            return "$link $desc </A>";
-        [/loop-calc] <br>
-    [/loop]
 
 * ADVANCED: Precompile and execute with [PREFIX-sub] and [PREFIX-exec]
 
@@ -2333,37 +2309,37 @@
 
 
 <programlisting><![CDATA[
+[benchmark start=1]
+
+loop-calc:
+<!--
+[loop search="st=db/fi=country/ra=yes/ml=1000"]
+  [loop-calc]
+    my $code = q{[loop-code]};
+    return "code '$code' reversed is " . reverse($code);
+  [/loop-calc]
+[/loop]
+-->
+
+[benchmark]
 
+<p>
+
+[benchmark start=1]
+loop-sub and loop-exec:
+<!--
+[loop search="st=db/fi=country/ra=yes/ml=1000"]
+  [loop-sub country_compare]
+    my $code = shift;
+    return "code '$code' reversed is " . reverse($code);
+  [/loop-sub]
+  [loop-exec country_compare][loop-code][/loop-exec]
+[/loop]
+-->
+
+[benchmark]
 ]]></programlisting>
 
-    [benchmark start=1]
-    loop-calc:
-      <!-
-            [loop search="st=db/fi=country/ra=yes/ml=1000"]
-            [loop-calc]
-                    my $code = q{[loop-code]};
-                    return "code '$code' reversed is " . reverse($code);
-            [/loop-calc]
-            [/loop]
-      ->
-                    
-    [benchmark]
-
-    <p>
-
-    [benchmark start=1]
-    loop-sub and loop-exec:
-      <!-
-            [loop search="st=db/fi=country/ra=yes/ml=1000"]
-            [loop-sub country_compare]
-                    my $code = shift;
-                    return "code '$code' reversed is " . reverse($code);
-            [/loop-sub]
-            [loop-exec country_compare][loop-code][/loop-exec]
-            [/loop]
-      ->
-                    
-    [benchmark]
 
 * ADVANCED: Execute and save with [query ...], then use an embedded &PERL;
 routine.
@@ -2379,50 +2355,54 @@
 
 
 <programlisting><![CDATA[
+[set waiting_for]os28004[/set]
 
-]]></programlisting>
+[benchmark start=1] Embedded &PERL;
+<!--
+[query arrayref=myref sql="select sku,price,description from products" /]
 
-  - begin test code -
-  [set waiting_for]os28004[/set]
-  
-  [benchmark start=1] Embedded &PERL;
-  <!-
-  [query arrayref=myref sql="select sku,price,description from products"]
-        <!- make query, this container text is not used. ->
-  [/query]
-  
-  [perl]
-    # Get the query results, has multiple fields
-    my $ary = $Tmp->{myref};
-    my $out = '';
-    foreach $line (@$ary) {
-        my ($sku, $price, $desc) = @$line;
-        if($sku eq $Scratch->{waiting_for}) {
-                $out .= "We were waiting for this one!!!!\n";
-        }
-        $out .= "sku: $sku price: $price description: $desc\n";
+[perl]
+  # Get the query results, has multiple fields
+  my $ary = $Tmp->{myref};
+  my $out = '';
+
+  foreach $line (@$ary) {
+    my ($sku, $price, $desc) = @$line;
+    if($sku eq $Scratch->{waiting_for}) {
+      $out .= "We were waiting for this one!!!!\n";
     }
-    return $out;
-  [/perl]
-  ->
-  TIME: [benchmark]
-  
-  [benchmark start=1] All loop
-  <!-
-  [query list=1 sql="select sku,price,description from products"]
-        [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]
-  ->
-  
-  TIME: [benchmark]
+    $out .= "sku: $sku price: $price description: $desc\n";
+  }
+  return $out;
+[/perl]
+-->
+
+TIME: [benchmark]
+
+
+[benchmark start=1] All loop
+
+<!--
+[query list=1 sql="select sku,price,description from products"]
+
+  [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]
+-->
+
+TIME: [benchmark]
+]]></programlisting>
+</para>
+</answer>
+</qandaentry>
 
+
+<!--
 * Other things that help:
 
 ** Avoid interpolate=1 when possible. A separate tag parser must be spawned



1.1                  xmldocs/guides/index.xml


rev 1.1, prev_rev 1.0
Index: index.xml
===================================================================
<?xml version="1.0" standalone="no"?>

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook-Interchange XML V4.2//EN"
"../docbook/docbookxi.dtd">

<book id='index'>

<bookinfo>
<title>XMLDOCS - Interchange Documentation Set</title>
<titleabbrev>index</titleabbrev>

<copyright>
	<year>2005</year>
	<holder>Davor Ocelic</holder>
	<holder>Interchange Development Group</holder>
</copyright>

<authorgroup>
	<author>
		<firstname>Davor</firstname><surname>Ocelic</surname>
		<email>docelic at icdevgroup.org</email>
	</author>
</authorgroup>

<legalnotice>
	<para>
	This documentation is free; you can redistribute it and/or modify
	it under the terms of the &GNU; General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
	</para>
	<para>
	It is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	</para>
</legalnotice>
</bookinfo>

<informaltable
	align='center' pgwide='1' orient='port' title='' label='' frame='vsides'
	summary='' cellspacing='2' cellpadding='2' border='0' rowheader='firstcol'>

	<tgroup cols='3'>
		<colspec colname="refs" />
		<colspec colname="misc" />
		<colspec colname="guides" />

		<thead>
			<row>
				<entry>References</entry>
				<entry>FAQs and Misc</entry>
				<entry>Guides</entry>
			</row>
		</thead>

		<tbody>
			<row>
				<entry>
					<emphasis role='bold'>
						(<olink targetdoc='glossary' targetptr='configuration'>?</olink>)
						Configuration Directives
					</emphasis><sbr/>
					<ulink url="confs/index.html">Multi-HTML</ulink> |
					<ulink url="confs.html">HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						Installation/Configuration FAQ
					</emphasis><sbr/>
					<ulink url="install.html">HTML</ulink> |
					<ulink url="install/index.html">Multi-HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						Catalog Tutorial
					</emphasis><sbr/>
					<ulink url="iccattut.html">HTML</ulink> |
					<ulink url="iccattut/index.html">Multi-HTML</ulink>
				</entry>
			</row>


			<row>
				<entry>
					<emphasis role='bold'>
						(<olink targetdoc='glossary' targetptr='ITL'>?</olink>)
						ITL Tags
					</emphasis><sbr/>
					<ulink url="tags/index.html">Multi-HTML</ulink> |
					<ulink url="tags.html">HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						HOWTOs Collection
					</emphasis><sbr/>
					<ulink url="howtos.html">HTML</ulink> |
					<ulink url="howtos/index.html">Multi-HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						Programming Style
					</emphasis><sbr/>
					<ulink url="programming-style.html">HTML</ulink> |
					<ulink url="programming-style/index.html">Multi-HTML</ulink>
				</entry>
			</row>


			<row>
				<entry>
					<emphasis role='bold'>
						(<olink targetdoc='glossary' targetptr='variable'>?</olink>)
						Variables
					</emphasis><sbr/>
					<ulink url="vars/index.html">Multi-HTML</ulink> |
					<ulink url="vars.html">HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						Optimization/Efficiency FAQ
					</emphasis><sbr/>
					<ulink url="optimization.html">HTML</ulink> |
					<ulink url="optimization/index.html">Multi-HTML</ulink>
				</entry>

				<entry>
					<emphasis role='bold'>
						Upgrade Guide
					</emphasis><sbr/>
					<ulink url="upgrade.html">HTML</ulink> |
					<ulink url="upgrade/index.html">Multi-HTML</ulink>
				</entry>
			</row>


			<row>
				<entry>
					<emphasis role='bold'>
						(<olink targetdoc='glossary' targetptr='filter'>?</olink>)
						Filters
					</emphasis><sbr/>
					<ulink url="filters/index.html">Multi-HTML</ulink> |
					<ulink url="filters.html">HTML</ulink>
				</entry>

				<entry>
				<!--
					<emphasis role='bold'>
					</emphasis><sbr/>
					<ulink url=".html">HTML</ulink> |
					<ulink url="/">Multi-HTML</ulink>
				-->
				</entry>

				<entry>
				<!--
					<emphasis role='bold'>
					</emphasis><sbr/>
					<ulink url=".html">HTML</ulink> |
					<ulink url="/">Multi-HTML</ulink>
				-->
				</entry>
			</row>


			<row>
				<entry>
					<emphasis role='bold'>
						(<olink targetdoc='glossary' targetptr='pragma'>?</olink>)
						Pragmas
					</emphasis><sbr/>
					<ulink url="pragmas/index.html">Multi-HTML</ulink> |
					<ulink url="pragmas.html">HTML</ulink>
				</entry>

				<entry>
				<!--
					<emphasis role='bold'>
					</emphasis><sbr/>
					<ulink url=".html">HTML</ulink> |
					<ulink url="/">Multi-HTML</ulink>
				-->
				</entry>

				<entry>
				<!--
					<emphasis role='bold'>
					</emphasis><sbr/>
					<ulink url=".html">HTML</ulink> |
					<ulink url="/">Multi-HTML</ulink>
				-->
				</entry>
			</row>


		</tbody>

	</tgroup>

</informaltable>

</book>



1.1                  xmldocs/images/docbook.png


<<docbook.png: PNG image data, 80 x 15, 8-bit/color RGB, non-interlaced>>


1.1                  xmldocs/images/lightlogo.png


<<lightlogo.png: PNG image data, 130 x 119, 8-bit/color RGB, non-interlaced>>


1.4       +1 -1      xmldocs/refs/backup-database.tag


rev 1.4, prev_rev 1.3
Index: backup-database.tag
===================================================================
RCS file: /var/cvs/xmldocs/refs/backup-database.tag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- backup-database.tag	20 Aug 2005 13:16:28 -0000	1.3
+++ backup-database.tag	1 Sep 2005 23:12:39 -0000	1.4
@@ -1,5 +1,5 @@
 __NAME__ purpose
-backup Interchange databases, optionally 
+backup Interchange databases, even rows selectively
 __END__
 
 __NAME__ synopsis 



1.3       +1 -1      xmldocs/refs/commify.filter


rev 1.3, prev_rev 1.2
Index: commify.filter
===================================================================
RCS file: /var/cvs/xmldocs/refs/commify.filter,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- commify.filter	9 Jun 2005 12:02:44 -0000	1.2
+++ commify.filter	1 Sep 2005 23:12:39 -0000	1.3
@@ -14,7 +14,7 @@
 [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]
 </programlisting>
 __END__
 








More information about the docs mailing list