Index: documentation/trunk/tutorials/xml-source/tutorial_en.xml
===================================================================
--- documentation/trunk/tutorials/xml-source/tutorial_en.xml (revision 26101)
+++ documentation/trunk/tutorials/xml-source/tutorial_en.xml (revision 26110)
@@ -1744,5 +1744,5 @@
-The search page includes a pulldown menu that allows you to select one of these partitions for searching. For example, try searching the relatives partition for mary and then search the monarchs partition for the same thing.
+The search page includes a pulldown menu that allows you to select one of these partitions for searching. For example, try searching the relatives partition for mary and then search the monarchs partition for the same thing.
@@ -1783,5 +1783,6 @@
-Open up your tudor collection, go to the panel (by clicking on its tab) and select from the left-hand list. Leave the editing controls at their default value, so that displays and is selected as the . The text in the box reads as follows:
+Open up your tudor collection, go to the panel (by clicking on its tab) and select from the left-hand list. Leave the editing controls at their default value, so that displays and is selected as the . The text in the box reads as follows:Select the format feature and inspect its long format statement.
+
<td valign=top>[link][icon][/link]</td>
@@ -1790,5 +1791,6 @@
{Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}
[/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td>
-
+
+
This displays something that looks like this:
@@ -1796,5 +1798,5 @@
for a particular document whose Title metadata is and whose Source metadata is .
-This format appears in the search results list, in the list, and also when you get down to individual documents in the hierarchy. This is Greenstone's default format statement.
+This format appears in the search results list, in the list, and also when you get down to individual documents in the hierarchy. This is Greenstone's default format statement used in the and format features..
@@ -1802,34 +1804,114 @@
-Delete the contents of the box and replace it with this simpler version:
-
+Delete the contents of the box and replace it with this simpler version:
+Replace the template of the format feature with:
+
+
<td>[link][icon][/link]</td>
<td>[ex.Title]<br>
<i>([ex.Source])</i>
</td>
-
-Preview the result (you don't need to build the collection, because changes to format statements take effect immediately). Look at some search results and at the list. They are just the same as before! Under most circumstances this far simpler format statement is entirely equivalent to Greenstone's more complex default.
+
+
+ <gsf:template match="documentNode">
+ <td valign="top">
+ <gsf:link type="document">
+ <gsf:icon type="document"/>
+ </gsf:link>
+ </td>
+ <td valign="top">
+ <gsf:metadata name="Title"/>
+ <br/>
+ <i>(<gsf:metadata name="Source"/>)</i>
+ </td>
+ </gsf:template>
+
+
+
+Replace the format feature with the above format statement too.
+
+Preview the result (you don't need to build the collection, because changes to format statements take effect immediately). Look at some search results and at the list. They are just the same as before! Under most circumstances this far simpler format statement is entirely equivalent to Greenstone's more complex default.
+
+We can also reduce the template of the format feature further, also without changing the display. Replace it with:
+
+ <gsf:template match="classifierNode[@classifierStyle = 'VList']">
+ <td valign="top">
+ <gsf:link type="classifier">
+ <gsf:icon type="classifier"/>
+ </gsf:link>
+ </td>
+ <td valign="top">
+ <gsf:metadata name="Title"/>
+ <br/>
+ <i>(<gsf:metadata name="Source"/>)</i>
+ </td>
+ </gsf:template>
+
+
+
But there's a problem. Beside the bookshelves in the browser, beneath the subject appears a mysterious "()". What is printed for these bookshelves is governed by the same format statement, and though bookshelf nodes of the hierarchy have associated Title metadata—their title is the name of the metadata value associated with that bookshelf—they do not have metadata, so it comes out blank.
-
-
+
+
+
+
In the section of the panel, the menu (just above menu) displays . That implies that the same format is used for the search results, titles, and all nodes in the subject hierarchy—including internal nodes (that is, bookshelves). The menu can be used to restrict a format statement to a specific one of these lists. We will override this format statement for the hierarchical subject classifier. In the menu, scroll down to the item that says
+
+
+Since we edited the format feature, the same format statements are used for the titles, and all nodes in the subject hierarchy—including internal nodes (that is, bookshelves). The menu can be used to restrict a format statement to a specific classifier and its nodes. We will override this format statement for the hierarchical subject classifier. In the menu, scroll down to the item that says
+
-CL2: Hierarchy -metadata
+CL2: Hierarchy -metadata
and select it. This is the format statement that affects the second classifier (i.e., "CL2"), which is a classifier based on metadata.
Click to add this format statement to the collection.
+
Edit the box below to read
-
+
+
+Edit the box below to contain the following format statements for the and templates. (The changes to the template are mostly the same as before, but without reference to the Source document. This time, the template is simplified further still.)
+
+
+
<td>[link][icon][/link]</td>
<td>[ex.Title]</td>
+
+
+<gsf:template match="documentNode">
+ <td valign="top">
+ <gsf:link type="document">
+ <gsf:icon type="document"/>
+ </gsf:link>
+ </td>
+ <td valign="top">
+ <gsf:metadata name="Title"/>
+ </td>
+ </gsf:template>
+
+ <gsf:template match="classifierNode[@classifierStyle = 'VList']">
+ <td valign="top">
+ <gsf:link type="classifier">
+ <gsf:icon type="classifier"/>
+ </gsf:link>
+ </td>
+ <td valign="top">
+ <gsf:metadata name="Title"/>
+ </td>
+ </gsf:template>
+
-Preview the list in the collection. First, the offending "()" has disappeared from the bookshelves. Second, when you get down to a list of documents in the subject hierarchy, the filename does not appear beside the title, because is not specified in the format statement and this format statement applies to all nodes in the subject classifier. Note that the search results and titles lists have not changed: they still display the filename underneath the title.
-
-
+Preview the list in the collection. First, the offending "()" has disappeared from the bookshelves. Second, whenWhen you get down to a list of documents in the subject hierarchy, the filename does not appear beside the title, because is not specified in the format statement and this format statement applies to all nodes in the subject classifier. Note that the search results and titles lists have not changed: they still display the filename underneath the title.
+
+
+
Let's change the search results format so that metadata is displayed here instead of the filename. In the menu (under on the panel), scroll down to the item and select it. Click to add this format statement to the collection. Change the box below to read
+
+
+Select the format feature once more for some further editing. Replace the line:
+
+
<td>[link][icon][/link]</td>
@@ -1838,8 +1920,20 @@
</td>
-
+
+
+
+ <i>(<gsf:metadata name="Source"/>)</i>
+
+with
+
+ <gsf:metadata name="dc.Subject"/>
+
+
+
+
To insert the , position the cursor at the appropriate point and either type it in, or select it from the drop down menu. This menu shows many of the things that you can put in square brackets in the format statement.
+
Preview the collection. Documents in the search results list will be displayed like this:
@@ -1849,8 +1943,9 @@
-Finally, let's return to the hierarchy and learn how to do different things to the bookshelves and to the documents themselves. In the menu, re-select the item
+Finally, let's return to the hierarchy and learn how to do different things to the bookshelves and to the documents themselves. In the menu, re-select the itemReselect the format feature for
-CL2: Hierarchy -metadata
-
+CL2: Hierarchy -metadata
+
+
Edit the box below to read
@@ -1864,7 +1959,22 @@
The statement tests the value of the variable . This variable is only set for internal nodes of the hierarchy, i.e. bookshelves, and gives the number of documents below that node. If it is set we take the first branch, otherwise we take the second. Commas are used to separate the branches. The curly brackets serve to indicate that the is special—otherwise the word itself would be output.
-
-
-Preview the collection and examine the subject hierarchy again to see the effect of your changes. Bookshelves should say and then the title, while documents will display and the title. Note that the number of documents in the bookshelf is not displayed: we are using [numleafdocs] to test what kind of item in the list we are at, but we are not displaying it.
+
+
+For the template, adjust its display of the title to:
+
+ <td valign="top">
+ <b>Title:</b> <gsf:metadata name="Title"/>
+ </td>
+
+Next adjust the title display of the template too:
+
+ <td valign="top">
+ <b>Bookshelf title:</b> <gsf:metadata name="Title"/>
+ </td>
+
+
+
+
+Preview the collection and examine the subject hierarchy again to see the effect of your changes. Bookshelves should say and then the title, while documents will display and the title. Note that the number of documents in the bookshelf is not displayed: we are using [numleafdocs] to test what kind of item in the list we are at, but we are not displaying it.