Index: documentation/trunk/shared/Dictionary.java
===================================================================
--- documentation/trunk/shared/Dictionary.java	(revision 26906)
+++ documentation/trunk/shared/Dictionary.java	(revision 27035)
@@ -40,4 +40,5 @@
 
     protected String gsdl_home = null;
+	protected String gsdl_or_gsdl3src_home = null;
     
     private ClassLoader classloader = null;
@@ -55,4 +56,13 @@
 	    System.exit(1);
 	}
+	
+	// Creating var gsdl_or_gsdl3src_home to point to GSDLHOME for GS2 and GSDL3SRCHOME for GS3
+	// since in GS3, gli is located in GSDL3SRCHOME, not in GSDLHOME (gs2build)	
+	String gsdl3_src_home = System.getProperty("GSDL3SRCHOME");
+	if(gsdl3_src_home == null || gsdl3_src_home.equals("")) { // both tests important
+		gsdl_or_gsdl3src_home = gsdl_home; // for GS2, all subfolders including gli are located in GSDLHOME
+	} else {
+		gsdl_or_gsdl3src_home = gsdl3_src_home;
+	}
 
 	this.classloader = new MyClassLoader(this.getClass().getClassLoader());
@@ -63,4 +73,14 @@
     }
     public String get(String key, String args) {
+	
+	boolean isGS3 = false;
+	String gsdl3_src_home = System.getProperty("GSDL3SRCHOME");
+	if(gsdl3_src_home != null && !gsdl3_src_home.equals("")) {
+		File gs3_installation = new File (gsdl3_src_home);
+		if(gs3_installation.exists()) {
+			isGS3 = true;
+		}
+	}
+	
 	int pos = key.indexOf("::");
 	if (pos==-1) {
@@ -76,16 +96,18 @@
 	    return getDictionaryText(glidict, key_name, args);
 	}
-	if (package_name.equals("coredm")) {
-	    loadDictionary(COREDM);
-	    return getMacroText(core_macros, key_name);
-	}
 	if (package_name.equals("perlmodules")) {
 	    loadDictionary(PERLMODULES);
 	    return getDictionaryText(perldict, key_name, args);
 	}
-	if (package_name.equals("auxdm")) {
-	    loadDictionary(AUXDM);
-	    return getMacroText(aux_macros, key_name);
-	}
+	if(!isGS3) {
+		if (package_name.equals("coredm")) {
+			loadDictionary(COREDM);
+			return getMacroText(core_macros, key_name);
+		}
+		if (package_name.equals("auxdm")) {
+			loadDictionary(AUXDM);
+			return getMacroText(aux_macros, key_name);
+		}
+	}	
 	if (package_name.equals("glihelp")) {
 	    return "";
@@ -103,5 +125,9 @@
 	    return key_name;
 	}
-	System.err.println("invalid package name "+package_name);
+	if(isGS3 && (package_name.equals("coredm") || package_name.equals("auxdm"))) {
+		//System.err.println("(package "+package_name+" does not exist for GS3)");
+	} else {
+		System.err.println("invalid package name "+package_name);
+	}
 	return "";
     }
@@ -243,5 +269,5 @@
 	}
 	
-	file_name = gsdl_home + File.separator + "gli" + File.separator + "metadata"+ File.separator + file_name;
+	file_name = gsdl_or_gsdl3src_home + File.separator + "gli" + File.separator + "metadata"+ File.separator + file_name;
 	//System.err.println("metadata filename = "+file_name);
 	File metadata_file = new File(file_name);
@@ -286,5 +312,5 @@
 
 	    super(parent);
-	    gliclassesdir = gsdl_home+File.separator+"gli"+File.separator+"classes";
+	    gliclassesdir = gsdl_or_gsdl3src_home+File.separator+"gli"+File.separator+"classes";
 	    perldir = gsdl_home+File.separator+"perllib";
 	    
Index: documentation/trunk/tutorials/generate-html.bat
===================================================================
--- documentation/trunk/tutorials/generate-html.bat	(revision 26906)
+++ documentation/trunk/tutorials/generate-html.bat	(revision 27035)
@@ -9,12 +9,13 @@
 goto exit
 
+:generate:
 setlocal
-
 set top_dir=%CD%
 set source_dir=%CD%\xml-source
 set processing_dir=%CD%\processing
 set output_dir=%CD%\html
-:generate:
-if not exist "%output_dir" mkdir %output_dir%
+set tmp_dir=%CD%\tmp
+if not exist "%output_dir%" mkdir %output_dir%
+if not exist "%tmp_dir%" mkdir %tmp_dir%
 cd ..
 cd shared
@@ -23,22 +24,34 @@
 
 
-set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar
+set GSDL_OR_GSDL3SRC_HOME=%GSDLHOME%
+:: this environment variable varies for GS3, where GLI is located in GSDL3SRCHOME (GS3) and not in GSDLHOME (gs2build)
+if not "%GSDL3SRCHOME%" == "" if exist "%GSDL3SRCHOME%" (	
+	set GSDL_OR_GSDL3SRC_HOME=%GSDL3SRCHOME%
+)
 
+set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDL_OR_GSDL3SRC_HOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar
+
+:: preprocess-tut-xml.xsl removes all the non-matching MajorVersion tags first
+:: This needs to be done in a separate pass, to ensure NumberedItems nested in  
+:: MajorVersion tags preserve their numbering. 
 echo "processing top level index"
-
-java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%source_dir%\tutorial_en.xml" %* > "%output_dir%\index.html"
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\preprocess-tut-xml.xsl"  "%source_dir%\tutorial_en.xml" %* > "%tmp_dir%\tutorial_en.xml"
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\index.html"
 
 echo "generating wiki index page"
-java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt"
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt"
 
 
 for %%G IN (en,fr,ru,es) do (
-if not exist "html\%%G" mkdir html\%%G
+if not exist "%output_dir%\%%G" mkdir "%output_dir%\%%G"
 
-echo "procesing %%G version"
+echo "processing %%G version"
 cd %output_dir%\%%G
-java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_%%G.xml" %* > "index.html"
-java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_%%G.xml" %* > "all_tutorials.html"
-java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_%%G.xml" %* | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl"
+
+if not "%%G" == "en" java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\preprocess-tut-xml.xsl" "%source_dir%\tutorial_%%G.xml" %* > "%tmp_dir%\tutorial_%%G.xml"
+
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "index.html"
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "all_tutorials.html"
+java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* | perl -S "%GSDL_OR_GSDL3SRC_HOME%\gli\help\splithelpdocument.pl"
 cd ..
 )
Index: documentation/trunk/tutorials/generate-html.sh
===================================================================
--- documentation/trunk/tutorials/generate-html.sh	(revision 26906)
+++ documentation/trunk/tutorials/generate-html.sh	(revision 27035)
@@ -21,5 +21,12 @@
 tmp_dir=`pwd`/tmp
 
-export CLASSPATH=$shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar
+
+export GSDL_OR_GSDL3SRC_HOME=$GSDLHOME
+# this environment variable varies for GS3, where GLI is located in GSDL3SRCHOME (GS3) and not in GSDLHOME (gs2build)
+if [ "$GSDL3SRCHOME" != "" ] && [ -d $GSDL3SRCHOME ]; then	
+	export GSDL_OR_GSDL3SRC_HOME=$GSDL3SRCHOME	
+fi
+
+export CLASSPATH=$shared_dir:$GSDLHOME/gli:$GSDL_OR_GSDL3SRC_HOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar
 
 if [ ! -d $output_dir ]; then
@@ -41,9 +48,9 @@
 
 echo "processing top level index"
-java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/preprocess-tut-xml.xsl  $source_dir/tutorial_en.xml "$@" > $tmp_dir/tutorial_en.xml
-java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-top-index.xsl  $tmp_dir/tutorial_en.xml "$@" > $output_dir/index.html
+java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/preprocess-tut-xml.xsl  $source_dir/tutorial_en.xml "$@" > $tmp_dir/tutorial_en.xml
+java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/xml-to-top-index.xsl  $tmp_dir/tutorial_en.xml "$@" > $output_dir/index.html
 
 echo "generating wiki index page"
-java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-wiki-index.xsl $tmp_dir/tutorial_en.xml "$@" > $output_dir/wiki-index.txt
+java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT "en" $processing_dir/xml-to-wiki-index.xsl $tmp_dir/tutorial_en.xml "$@" > $output_dir/wiki-index.txt
 
 for l in $langs; do
@@ -55,9 +62,9 @@
 
     if [ "$l" != "en" ]; then
-	java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/preprocess-tut-xml.xsl $source_dir/tutorial_$l.xml "$@" > $tmp_dir/tutorial_$l.xml
+	java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/preprocess-tut-xml.xsl $source_dir/tutorial_$l.xml "$@" > $tmp_dir/tutorial_$l.xml
     fi
-    java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $tmp_dir/tutorial_$l.xml "$@" > index.html
-    java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $tmp_dir/tutorial_$l.xml "$@" > all_tutorials.html
-    java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $tmp_dir/tutorial_$l.xml "$@" | perl -S $GSDLHOME/gli/help/splithelpdocument.pl
+    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $tmp_dir/tutorial_$l.xml "$@" > index.html
+    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $tmp_dir/tutorial_$l.xml "$@" > all_tutorials.html
+    java -DGSDLHOME=$GSDLHOME -DGSDL3SRCHOME=$GSDL3SRCHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $tmp_dir/tutorial_$l.xml "$@" | perl -S $GSDL_OR_GSDL3SRC_HOME/gli/help/splithelpdocument.pl
     cd $top_dir
 done
