Index: documentation/trunk/tutorials/xml-source/tutorial_en.xml
===================================================================
--- documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 28619)
+++ documentation/trunk/tutorials/xml-source/tutorial_en.xml	(revision 28629)
@@ -3261,4 +3261,5 @@
 <Text id="0575a">Note how we assigned <AutoText key="metadata::dc.Format"/> metadata to all documents in the collection with a minimum of labour. We did this by capitalizing on the folder structure of the original information. Even though we complained earlier about how messy this folder structure is, you can still take advantage of it when assigning metadata.</Text>
 </Comment>
+<MajorVersion number="2">
 <Heading>
 <Text id="0579">Suppressing dummy text</Text>
@@ -3271,8 +3272,7 @@
 </Bullet>
 <Bullet>
-<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="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="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/>
@@ -3280,6 +3280,41 @@
 {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;
+</Format> 
+<Text id="0583">to this:</Text>
+<Format>
+&lt;td valign=top&gt;<br/>
+<highlight>{If}{[dc.Format] eq 'Audio', </highlight><br/>
+<highlight>[srclink][srcicon][/srclink], </highlight><br/>
+<highlight>{If}{[dc.Format] eq 'Images',</highlight><br/> 
+<highlight>[srclink][thumbicon][/srclink],</highlight><br/> 
+<highlight>{If}{[dc.Format] eq 'Supplementary',</highlight><br/>
+<highlight>[srclink][srcicon][/srclink] [link][icon][/link],</highlight>
+<highlight>[link][icon][/link]}}}</highlight>&lt;/td&gt; <br/>
+&lt;td valign=top&gt;[highlight]<br/>
+{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;
+</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>
+<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>
 </MajorVersion>
 <MajorVersion number="3">
+<Heading>
+<Text id="0579">Using switch statements</Text>
+</Heading>
+<NumberedItem>
+<Text id="0580">Alongside the Audio files there is an MP3 icon, which plays the audio when you click it. There is also a document icon, which doesn't make much sense with either audio or image files. We can modify the format statement to display different icons depending on the value of the <b>dc.Format</b> metadata field.</Text>
+<BulletList>
+<Bullet>
+<Text id="0581">Change to the <AutoText key="glidict::GUI.Format"/> panel and select the <AutoText key="glidict::CDM.GUI.Formats"/> section.</Text>
+</Bullet>
+<Bullet>
+<Text id="0582">Ensure that the <AutoText text="browse"/> format feature is selected, and make the changes that are highlighted below to its <AutoText text="documentNode"/> template. </Text>
+<Text id="0582a">Change:</Text>
+<Format>
     &lt;td valign=&quot;top&quot;&gt;<br />
       <Tab n="1"/><highlight>&lt;gsf:link type=&quot;document&quot;&gt;<br />
@@ -3295,22 +3330,7 @@
       <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/>
-<highlight>[srclink][srcicon][/srclink], </highlight><br/>
-<highlight>{If}{[dc.Format] eq 'Images',</highlight><br/> 
-<highlight>[srclink][thumbicon][/srclink],</highlight><br/> 
-<highlight>{If}{[dc.Format] eq 'Supplementary',</highlight><br/>
-<highlight>[srclink][srcicon][/srclink] [link][icon][/link],</highlight>
-<highlight>[link][icon][/link]}}}</highlight>&lt;/td&gt; <br/>
-&lt;td valign=top&gt;[highlight]<br/>
-{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 />
@@ -3331,13 +3351,13 @@
   <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<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="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 (Be sure to use WordPad rather than Notepad, because Notepad does not display the line breaks correctly.):</Text>
+<Path>sample_files &rarr; beatles &rarr; format_tweaks &rarr; audio_tweak_3.txt</Path> 
+<Text id="0586">The <Format>gsf:switch</Format> statement allows you to display different things depending on the value (or existence) of a metadata field. This switch statement is based on the value of <b>dc.Format</b>. If dc.Format equals <i>Audio</i>, then the source icon will be displayed, linking to the source document. (For the MP3 files, the MP3 icon will display, and clicking the icon will play the MP3.) If dc.Format equals <i>Images</i>, the image thumbnail will appear, linking to the full-size image. If dc.Format equals <i>Supplementary</i>, both the source and document icons will appear, linking to the source document and the document display page, respectively. Finally, the <Format>gsf:otherwise</Format> statement says what to do in all other cases.</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>
+</MajorVersion>
 <NumberedItem>
 <Text id="0593">While we're at it, let's remove the source filename from where it appears after each document.</Text>
@@ -3425,12 +3445,12 @@
 <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. Insert the highlighted statements:</Text> 
 <Format>
-      <Tab n="1"/>&lt;gsf:template match=&quot;classifierNode[@classifierStyle = 'VList']&quot;&gt;<br />
-	  <Tab n="1"/>...<br />
-      <Tab n="1"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br />
-	 &lt;/td&gt;<br />
-    <highlight>&lt;td valign=&quot;top&quot;&gt;<br />
-       <Tab n="1"/>(&lt;gsf:metadata name=&quot;numleafdocs&quot;/&gt;)<br />
-    &lt;/td&gt;</highlight>
-	&lt;gsf:template<br />
+&lt;gsf:template match=&quot;classifierNode[@classifierStyle = 'VList']&quot;&gt;<br />
+	  <Tab n="2"/>...<br />
+      <Tab n="2"/>&lt;gsf:metadata name=&quot;Title&quot;/&gt;<br />
+	 <Tab n="1"/>&lt;/td&gt;<br />
+    <highlight><Tab n="1"/>&lt;td valign=&quot;top&quot;&gt;<br />
+       <Tab n="2"/>(&lt;gsf:metadata name=&quot;numleafdocs&quot;/&gt;)<br />
+    <Tab n="1"/>&lt;/td&gt;</highlight><br />
+&lt;gsf:template<br />
 </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>
@@ -3516,5 +3536,5 @@
 </NumberedItem>
 <NumberedItem>
-<Text id="0645">Using your Windows file browser outside Greenstone, locate the folder</Text>
+<Text id="0645">Using your file browser outside Greenstone, locate the folder</Text>
 <Path>sample_files &rarr; beatles &rarr; advbeat_large</Path> 
 </NumberedItem>
@@ -4624,5 +4644,5 @@
 </NumberedItem>
 <NumberedItem>
-<Text id="0759">In your Windows file browser, locate the <Path>archives</Path> folder for the collection you are working with (in <Path>Greenstone<MajorVersion number="3">3 &rarr; web &rarr; sites &rarr; localsite</MajorVersion> &rarr; collect &rarr; &lt;collname&gt; &rarr; archives</Path>). For each document in the collection, Greenstone has generated two files: <Path>docmets.xml</Path>, the core METS description, and <Path>doctxt.xml</Path>, a supporting file. (Note: unless you are connected to the Internet you may be unable to view <Path>doctxt.xml</Path> in your web browser, because it refers to a remote resource.) Depending on the source documents there may be additional files, such as the images used within a web page. One of METS' many features is the ability to reference information in external XML files. Greenstone uses this to tie the content of the document, which is stored in the external XML file <Path>doctxt.xml</Path>, to its hierarchical structure, which is described in the core METS file <Path>docmets.xml</Path>.</Text>
+<Text id="0759">In your file browser, locate the <Path>archives</Path> folder for the collection you are working with (in <Path>Greenstone<MajorVersion number="3">3 &rarr; web &rarr; sites &rarr; localsite</MajorVersion> &rarr; collect &rarr; &lt;collname&gt; &rarr; archives</Path>). For each document in the collection, Greenstone has generated two files: <Path>docmets.xml</Path>, the core METS description, and <Path>doctxt.xml</Path>, a supporting file. (Note: unless you are connected to the Internet you may be unable to view <Path>doctxt.xml</Path> in your web browser, because it refers to a remote resource.) Depending on the source documents there may be additional files, such as the images used within a web page. One of METS' many features is the ability to reference information in external XML files. Greenstone uses this to tie the content of the document, which is stored in the external XML file <Path>doctxt.xml</Path>, to its hierarchical structure, which is described in the core METS file <Path>docmets.xml</Path>.</Text>
 </NumberedItem>
 </Content>
