Index: documentation/trunk/tutorials/xml-source/tutorial_en.xml
===================================================================
--- documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 26110)
+++ documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 26122)
@@ -2775,5 +2775,7 @@
 <Path>sample_files &rarr; beatles &rarr; advbeat_small</Path> 
 <Text id="0555">into your new collection. Do this by opening up <Path>advbeat_small</Path>, selecting the eight items within it (from <Path>discography</Path> to <Path>beatles_midi.zip</Path>), and dragging them across. Because some of these files are in MP3 and MARC formats you will be asked whether to include <AutoText text="MP3Plugin" /> and <AutoText text="MARCPlugin" /> in your collection. Click <AutoText key="glidict::CDM.PlugInManager.QuickAdd" type="button"/>.</Text>
+<MajorVersion number="2">
 <Text id="0555a">A window may pop up explaining that the import documents contain css files, which none of Greenstone's plugins are expected to process directly. CSS files normally belong to a web page and we don't need to process them directly. Click <AutoText key="glidict::General.OK" type="button"/> button.</Text>
+</MajorVersion>
 </NumberedItem>
 <NumberedItem>
@@ -2837,7 +2839,8 @@
 </Bullet>
 <Bullet>
-<Text id="0582">Ensure that <AutoText text="VList"/> is selected, and make the changes that are highlighted below. You need to insert five lines into the first line, and delete the second line. (Note, the changes are available in a text file, see below.)</Text>
+<Text id="0582">Ensure that <MajorVersion number="2"><AutoText text="VList"/></MajorVersion><MajorVersion number="3">the <AutoText text="browse"/> format feature</MajorVersion> is selected, and make the changes that are highlighted below<MajorVersion number="3"> to its <AutoText text="documentNode"/> template</MajorVersion>.<MajorVersion number="2"> You need to insert five lines into the first line, and delete the second line. (Note, the changes are available in a text file, see below.)</MajorVersion> </Text>
 <Text id="0582a">Change:</Text>
 <Format>
+<MajorVersion number="2">
 &lt;td valign=top&gt;<highlight>[link][icon][/link]</highlight>&lt;/td&gt;<br/> 
 <highlight>&lt;td valign=top&gt;[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]&lt;/td&gt; </highlight><br/>
@@ -2845,7 +2848,24 @@
 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled} <br/>
 [/highlight]{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}&lt;/td&gt;
+</MajorVersion>
+<MajorVersion number="3">
+    &lt;td valign=&quot;top&quot;&gt;<br />
+      <Tab n="1"/><highlight>&lt;gsf:link type=&quot;document&quot;&gt;<br />
+        <Tab n="2"/>&lt;gsf:icon type=&quot;document&quot;/&gt;<br />
+      <Tab n="1"/>&lt;/gsf:link&gt;<br />
+    &lt;/td&gt;<br />
+    &lt;td valign=&quot;top&quot;&gt;<br />
+      <Tab n="1"/>&lt;gsf:link type=&quot;source&quot;&gt;<br />
+        <Tab n="2"/>&lt;gsf:choose-metadata&gt;<br />
+          <Tab n="3"/>&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;<br />
+          <Tab n="3"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br />
+        <Tab n="2"/>&lt;/gsf:choose-metadata&gt;<br />
+      <Tab n="1"/>&lt;/gsf:link&gt;</highlight><br />
+    &lt;/td&gt;
+</MajorVersion>
 </Format> 
 <Text id="0583">to this:</Text>
 <Format>
+<MajorVersion number="2">
 &lt;td valign=top&gt;<br/>
 <highlight>{If}{[dc.Format] eq 'Audio', </highlight><br/>
@@ -2859,10 +2879,30 @@
 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/>
 [/highlight]{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}&lt;/td&gt;
+</MajorVersion>
+<MajorVersion number="3">
+&lt;td valign=&quot;top&quot;&gt;<br />
+  <Tab n="1"/><highlight>&lt;gsf:switch&gt;<br />
+    <Tab n="2"/>&lt;gsf:metadata name=&quot;dc.Format&quot;/&gt;<br />
+    <Tab n="2"/>&lt;gsf:when test='equals' test-value='Audio'&gt;<br />
+      <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;&lt;/gsf:link&gt;<br />
+    <Tab n="2"/>&lt;/gsf:when&gt;<br />
+    <Tab n="2"/>&lt;gsf:when test='equals' test-value='Images'&gt;<br />
+      <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;&lt;/gsf:link&gt;<br />
+    <Tab n="2"/>&lt;/gsf:when&gt;<br />
+    <Tab n="2"/>&lt;gsf:when test='equals' test-value='Supplementary'&gt;<br />
+      <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;&lt;/gsf:link&gt; &lt;gsf:link type=&quot;document&quot;&gt;&lt;gsf:icon type=&quot;document&quot;/&gt;&lt;/gsf:link&gt;<br />
+    <Tab n="2"/>&lt;/gsf:when&gt;<br />
+    <Tab n="2"/>&lt;gsf:otherwise&gt;<br />
+      <Tab n="3"/>&lt;gsf:link type=&quot;document&quot;&gt;&lt;gsf:icon type=&quot;document&quot;/&gt;&lt;/gsf:link&gt;<br />
+    <Tab n="2"/>&lt;/gsf:otherwise&gt;<br />
+  <Tab n="1"/>&lt;/gsf:switch&gt;</highlight><br />
+&lt;/td&gt;
+</MajorVersion>
 </Format> 
 </Bullet>
 </BulletList>
 <Text id="0585">To make this easier for you we have prepared a plain text file that contains the new text. In WordPad open the following file:</Text>
-<Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; audio_tweak.txt</Path> 
-<Text id="0586">(Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.) Place it in the copy buffer by highlighting the text in WordPad and selecting <Menu>Edit &rarr; Copy</Menu>. Now move back to the Librarian Interface, highlight all the text that makes up the current <AutoText text="VList"/> format statement, and use <Menu><AutoText key="glidict::Menu.Edit"/> &rarr; <AutoText key="glidict::Menu.Edit_Paste"/></Menu> to transform the old statement to the new one.</Text>
+<Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; audio_tweak<MajorVersion number="3">_3</MajorVersion>.txt</Path> 
+<Text id="0586">(Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.) Place it in the copy buffer by highlighting the text in WordPad and selecting <Menu>Edit &rarr; Copy</Menu>. Now move back to the Librarian Interface, <MajorVersion number="2">highlight all the text that makes up the current <AutoText text="VList"/> format statement</MajorVersion><MajorVersion number="3">highlight the portion of the existing <AutoText text="documentNode"/> template of the <AutoText text="browse"/> format statement that needs to be replaced</MajorVersion>, and use <Menu><AutoText key="glidict::Menu.Edit"/> &rarr; <AutoText key="glidict::Menu.Edit_Paste"/></Menu> to transform the old statement to the new one.</Text>
 <Text id="0589"><b>Preview</b> the result. You may need to click the browser's &lt;<b>Reload</b>&gt; button to force it to re-load the page.</Text>
 </NumberedItem>
@@ -2871,6 +2911,12 @@
 <BulletList>
 <Bullet>
+<MajorVersion number="2">
 <Text id="0594">In the <AutoText text="VList"/> format feature, delete the text that is highlighted below:</Text>
-<Format>
+</MajorVersion>
+<MajorVersion number="3">
+<Text id="0594-3">In the <AutoText text="documentNode"/> template of the <AutoText text="browse"/> format feature, delete the following text:</Text>
+</MajorVersion>
+<Format>
+<MajorVersion number="2">
 &lt;td valign=top&gt;<br/>
 {If}{[dc.Format] eq 'Audio',<br/> 
@@ -2883,5 +2929,16 @@
 &lt;td valign=top&gt;[highlight]<br/>
 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/>
-[/highlight]<highlight>{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}</highlight>&lt;/td&gt;</Format> 
+[/highlight]<highlight>{If}{[ex.Source],&lt;br&gt;&lt;i&gt;([ex.Source])&lt;/i&gt;}</highlight>&lt;/td&gt;
+</MajorVersion>
+<MajorVersion number="3">
+      &lt;gsf:switch&gt;<br />
+        <Tab n="1"/>&lt;gsf:metadata name=&quot;Source&quot;/&gt;<br />
+        <Tab n="1"/>&lt;gsf:when test=&quot;exists&quot;&gt;<br />
+          <Tab n="2"/>&lt;br/&gt;<br />
+          <Tab n="2"/>&lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br />
+        <Tab n="1"/>&lt;/gsf:when&gt;<br />
+      &lt;/gsf:switch&gt;
+</MajorVersion>
+</Format> 
 </Bullet>
 </BulletList>
@@ -2916,4 +2973,5 @@
 </Heading>
 <NumberedItem>
+<MajorVersion number="2">
 <Text id="0606">Make the bookshelves show how many documents they contain by inserting a line in the <AutoText text="VList"/> format statement in the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel. The added line is shown highlighted below. The complete format statement can be copied from <Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; show_num_docs.txt</Path>.</Text>
 <Format>
@@ -2930,4 +2988,30 @@
 {Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}<br/>
 [/highlight]&lt;/td&gt;</Format> 
+</MajorVersion>
+<MajorVersion number="3">
+<Text id="0606-3">Make the bookshelves show how many documents they contain by modifying the <AutoText text="VList classifierNode"/> template of the <AutoText text="browse"/> format feature in the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel. Remove the portion highlighted below:</Text> 
+<Format>
+      <Tab n="1"/>...<br />
+      <Tab n="1"/>&lt;xsl:call-template name=&quot;choose-title&quot;/&gt;<br />
+      <Tab n="1"/><highlight>&lt;gsf:switch&gt;<br />
+        <Tab n="2"/>&lt;gsf:metadata name=&quot;Source&quot;/&gt;<br />
+        <Tab n="2"/>&lt;gsf:when test=&quot;exists&quot;&gt;<br />
+          <Tab n="3"/>&lt;br/&gt;<br />
+          <Tab n="3"/>&lt;i&gt;(&lt;gsf:metadata name=&quot;Source&quot;/&gt;)&lt;/i&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+      <Tab n="1"/>&lt;/gsf:switch&gt;<br />
+    &lt;/td&gt;</highlight>
+</Format>
+And replace it with the statements highlighted here:
+<Format>
+      <Tab n="1"/>...<br />
+      <Tab n="1"/>&lt;xsl:call-template name=&quot;choose-title&quot;/&gt;<br />
+    <highlight>&lt;/td&gt;<br />
+    &lt;td&gt;<br />
+       <Tab n="1"/>(&lt;gsf:metadata name=&quot;numleafdocs&quot;/&gt;)<br />
+    &lt;/td&gt;</highlight>
+</Format>
+<Text id="0606-3a">The complete format statement for the <AutoText text="VList classifierNode"/> template of the <AutoText text="browse"/> format feature can be copied from <Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; show_num_docs_3.txt</Path>.</Text>
+</MajorVersion>
 <Text id="0609"><b>Preview</b> the result (you don't need to build the collection.) Bookshelves in the titles and browse classifiers should show how many documents they contain.</Text>
 </NumberedItem>
@@ -2994,5 +3078,5 @@
 </Bullet>
 </BulletList>
-<Text id="0638"><b>Build</b> the collection and <b>preview</b> the result. Observe how many more times similar titles have been amalgamated under the same bookshelf. Test your understanding of regular expressions by trying to rationalize the amalgamations. (Note: <AutoText text="[[:punct:]]" type="italics"/> stands for any punctuation character.) The icons beside the Word and PDF documents are not the correct ones, but that will be fixed in the next format statement.</Text>
+<Text id="0638"><b>Build</b> the collection and <b>preview</b> the result. Observe how many more times similar titles have been amalgamated under the same bookshelf. Test your understanding of regular expressions by trying to rationalize the amalgamations. (Note: <AutoText text="[[:punct:]]" type="italics"/> stands for any punctuation character.)<MajorVersion number="2"> The icons beside the Word and PDF documents are not the correct ones, but that will be fixed in the next format statement.</MajorVersion></Text>
 </NumberedItem>
 <Comment>
@@ -3000,5 +3084,6 @@
 </Comment>
 <Heading>
-<Text id="0643">Using non-standard macro files</Text>
+<MajorVersion number="2"><Text id="0643">Using non-standard macro files</Text></MajorVersion>
+<MajorVersion number="3"><Text id="0647">Using different icons for different media types</Text></MajorVersion>
 </Heading>
 <Comment>
@@ -3018,13 +3103,24 @@
 </NumberedItem>
 <NumberedItem>
+<MajorVersion number="2">
 <Text id="0646">Using the file browser, copy the <Path>images</Path> and <Path>macros</Path> folders from the <Path>advbeat_large</Path> folder into the <Path>smallbea</Path> folder. (It's OK to overwrite the existing <Path>images</Path> folder: the image in it is included in the folder being copied.) The <Path>images</Path> folder includes some useful icons, and the <Path>macros</Path> folder defines some macro names that use these images.</Text>
+</MajorVersion>
+<MajorVersion number="3">
+<Text id="0646-3">Using the file browser, copy the <Path>images</Path> folder from the <Path>advbeat_large</Path> folder into the <Path>smallbea</Path> folder. (It's OK to overwrite the existing <Path>images</Path> folder: the image in it is included in the folder being copied.) The <Path>images</Path> folder includes some useful icons.</Text>
+</MajorVersion>
+<MajorVersion number="2">
 <Text id="0646a">To see the macro definitions, open the collection in the Librarian Interface (<Menu><AutoText key="glidict::Menu.File"/> &rarr; <AutoText key="glidict::Menu.File_Open"/></Menu>) and view the <AutoText key="glidict::CDM.GUI.Macros"/> section in the <AutoText key="glidict::GUI.Format"/> panel.</Text>
-</NumberedItem>
+</MajorVersion>
+</NumberedItem>
+<MajorVersion number="2">
 <Heading>
 <Text id="0647">Using different icons for different media types</Text>
 </Heading>
-<NumberedItem>
-<Text id="0648">Re-edit your <AutoText text="VList" /> format statement to be the following (in <AutoText key="glidict::CDM.GUI.Formats"/> on the <AutoText key="glidict::GUI.Format"/> panel). You can copy this text from the file <Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; multi_icons.txt</Path>.</Text>
-<Format><highlight>&lt;td valign=top&gt;</highlight><br/> 
+</MajorVersion>
+<NumberedItem>
+<Text id="0648">Re-edit <MajorVersion number="2"><AutoText text="VList" /> your format statement</MajorVersion><MajorVersion number="3">the previously edited portion of the <AutoText text="documentNode"/> format statement of the <AutoText text="browse"/> format feature</MajorVersion> (in <AutoText key="glidict::CDM.GUI.Formats"/> on the <AutoText key="glidict::GUI.Format"/> panel) to be the following. You can copy this text from the file <Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; multi_icons<MajorVersion number="3">_3</MajorVersion>.txt</Path>.</Text>
+<Format>
+<MajorVersion number="2">
+<highlight>&lt;td valign=top&gt;</highlight><br/> 
 &nbsp;&nbsp;<highlight>{If}{[numleafdocs],[link][icon][/link]}</highlight><br/> 
 &nbsp;&nbsp;<highlight>{If}{[dc.Format] eq 'Lyrics',[link]_iconlyrics_[/link]}</highlight><br/> 
@@ -3043,8 +3139,60 @@
 {Or}{[dc.Title],[Title],Untitled}<br/> 
 [/highlight]<br/> 
-&lt;/td&gt;</Format> 
-</NumberedItem>
-<NumberedItem>
-<Text id="0651"><b>Preview</b> your collection as before. Now different icons are used for discography, lyrics, tablature, and MARC metadata. Even MP3 and MIDI audio file types are distinguished. If you let the mouse hover over one of these images a "tool tip" appears explaining what file type the icon represents in the current interface language (note: <Path>extra.dm</Path> only defines English and French).</Text>
+&lt;/td&gt;
+</MajorVersion>
+<MajorVersion number="3">
+  &lt;td valign=&quot;top&quot;&gt;<br />
+     <Tab n="1"/>&lt;gsf:switch&gt;<br />
+        <Tab n="2"/>&lt;gsf:metadata name=&quot;dc.Format&quot;/&gt;<br />
+	<Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Lyrics&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;document&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:icon file=&quot;lyrics.gif&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+	<Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Discography&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;document&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:icon file=&quot;disc.gif&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+	<Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Tablature&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;document&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:icon file=&quot;tab.gif&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+	<Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;MARC&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;document&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:icon file=&quot;marc.gif&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+        <Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Images&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:metadata name=&quot;thumbicon&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+        <Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Supplementary&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;<br />
+            <Tab n="4"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+	<Tab n="2"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;Audio&quot;&gt;<br />
+          <Tab n="3"/>&lt;gsf:link type=&quot;source&quot;&gt;<br />
+	      <Tab n="4"/>&lt;gsf:switch&gt;<br />
+		<Tab n="5"/>&lt;gsf:metadata name=&quot;FileFormat&quot;/&gt;<br />
+		<Tab n="5"/>&lt;gsf:when test=&quot;equals&quot; test-value=&quot;MIDI&quot;&gt;<br />
+	          <Tab n="6"/>&lt;gsf:icon file=&quot;midi.gif&quot;/&gt;<br />
+	        <Tab n="5"/>&lt;/gsf:when&gt;<br />
+		<Tab n="5"/>&lt;gsf:otherwise&gt;<br />
+	          <Tab n="6"/>&lt;gsf:metadata name=&quot;srcicon&quot;/&gt;<br />
+		<Tab n="5"/>&lt;/gsf:otherwise&gt;<br />
+	      <Tab n="4"/>&lt;/gsf:switch&gt;<br />
+          <Tab n="3"/>&lt;/gsf:link&gt;<br />
+        <Tab n="2"/>&lt;/gsf:when&gt;<br />
+      <Tab n="1"/>&lt;/gsf:switch&gt;<br />
+    &lt;/td&gt;
+</MajorVersion>
+</Format> 
+</NumberedItem>
+<NumberedItem>
+<Text id="0651"><b>Preview</b> your collection as before. Now different icons are used for discography, lyrics, tablature, and MARC metadata. Even MP3 and MIDI audio file types are distinguished.<MajorVersion number="2"> If you let the mouse hover over one of these images a "tool tip" appears explaining what file type the icon represents in the current interface language (note: <Path>extra.dm</Path> only defines English and French).</MajorVersion></Text>
 </NumberedItem>
 <Heading>
