doc/tutorial/includeaddattribute.c doc/tutorial/includeaddkeyword.c


Sat Aug 31 19:31:17 MDT 2002 John Fleck <jfleck@inkstain.net>

	* doc/tutorial/includeaddattribute.c
	* doc/tutorial/includeaddkeyword.c
	* doc/tutorial/includegetattribute.c
	* doc/tutorial/includekeyword.c
	* doc/tutorial/xmltutorial.xml
	* doc/tutorial/*.html
	update tutorial to properly free memory (thanks to Christopher
	R. Harris for pointing out that this needs to be done)
	* doc/tutorial/images/callouts/*.png
	added image files so the callouts are graphical, making it
	easier to read ( use "--param callout.graphics 1" to generate
	html with graphical callouts)
diff --git a/ChangeLog b/ChangeLog
index f640545..ce29a5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Sat Aug 31 19:31:17 MDT 2002 John Fleck <jfleck@inkstain.net>
+
+	* doc/tutorial/includeaddattribute.c
+	* doc/tutorial/includeaddkeyword.c
+	* doc/tutorial/includegetattribute.c
+	* doc/tutorial/includekeyword.c
+	* doc/tutorial/xmltutorial.xml
+	* doc/tutorial/*.html
+	update tutorial to properly free memory (thanks to Christopher
+	R. Harris for pointing out that this needs to be done)
+	* doc/tutorial/images/callouts/*.png
+	added image files so the callouts are graphical, making it
+	easier to read ( use "--param callout.graphics 1" to generate
+	html with graphical callouts)
+	
 Wed Aug 28 13:44:54 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
 	* doc/Libxml2-Logo-180x168.gif doc/Libxml2-Logo-90x34.gif:
diff --git a/doc/tutorial/apa.html b/doc/tutorial/apa.html
index 375fb69..525dd31 100644
--- a/doc/tutorial/apa.html
+++ b/doc/tutorial/apa.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>A. Sample Document</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s07.html" title="Retrieving Attributes"><link rel="next" href="apb.html" title="B. Code for Keyword Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">A. Sample Document</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s07.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="sampledoc"></a>A. Sample Document</h2><pre class="programlisting">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>A. Sample Document</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s07.html" title="Retrieving Attributes"><link rel="next" href="apb.html" title="B. Code for Keyword Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">A. Sample Document</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s07.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="sampledoc"></a>A. Sample Document</h2><pre class="programlisting">
 &lt;?xml version=&quot;1.0&quot;?&gt;
 &lt;story&gt;
   &lt;storyinfo&gt;
diff --git a/doc/tutorial/apb.html b/doc/tutorial/apb.html
index e3b119f..37835d6 100644
--- a/doc/tutorial/apb.html
+++ b/doc/tutorial/apb.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>B. Code for Keyword Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apa.html" title="A. Sample Document"><link rel="next" href="apc.html" title="C. Code for Add Keyword Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">B. Code for Keyword Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="keywordappendix"></a>B. Code for Keyword Example</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>B. Code for Keyword Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apa.html" title="A. Sample Document"><link rel="next" href="apc.html" title="C. Code for Add Keyword Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">B. Code for Keyword Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="keywordappendix"></a>B. Code for Keyword Example</h2><p>
       <pre class="programlisting">
 #include &lt;stdio.h&gt;
 #include &lt;string.h&gt;
@@ -55,7 +55,9 @@
 		 
 	cur = cur-&gt;next;
 	}
-       
+	
+	xmlFreeDoc(doc);
+	return;
 }
 
 int
diff --git a/doc/tutorial/apc.html b/doc/tutorial/apc.html
index 62ca6b2..37d5289 100644
--- a/doc/tutorial/apc.html
+++ b/doc/tutorial/apc.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>C. Code for Add Keyword Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apb.html" title="B. Code for Keyword Example"><link rel="next" href="apd.html" title="D. Code for Add Attribute Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">C. Code for Add Keyword Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apd.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="addkeywordappendix"></a>C. Code for Add Keyword Example</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>C. Code for Add Keyword Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apb.html" title="B. Code for Keyword Example"><link rel="next" href="apd.html" title="D. Code for Add Attribute Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">C. Code for Add Keyword Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apd.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="addkeywordappendix"></a>C. Code for Add Keyword Example</h2><p>
       <pre class="programlisting">
 #include &lt;stdio.h&gt;
 #include &lt;string.h&gt;
@@ -24,6 +24,7 @@
 	
 	if (doc == NULL ) {
 		fprintf(stderr,&quot;Document not parsed successfully. \n&quot;);
+		xmlFreeDoc(doc);
 		return (NULL);
 	}
 	
@@ -69,7 +70,9 @@
 	doc = parseDoc (docname, keyword);
 	if (doc != NULL) {
 		xmlSaveFormatFile (docname, doc, 0);
+		xmlFreeDoc(doc);
 	}
+	
 	return (1);
 }
 
diff --git a/doc/tutorial/apd.html b/doc/tutorial/apd.html
index 5e56f3c..3425c86 100644
--- a/doc/tutorial/apd.html
+++ b/doc/tutorial/apd.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>D. Code for Add Attribute Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apc.html" title="C. Code for Add Keyword Example"><link rel="next" href="ape.html" title="E. Code for Retrieving Attribute Value Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">D. Code for Add Attribute Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apc.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ape.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="addattributeappendix"></a>D. Code for Add Attribute Example</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D. Code for Add Attribute Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apc.html" title="C. Code for Add Keyword Example"><link rel="next" href="ape.html" title="E. Code for Retrieving Attribute Value Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">D. Code for Add Attribute Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apc.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ape.html">Next</a></td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="addattributeappendix"></a>D. Code for Add Attribute Example</h2><p>
       <pre class="programlisting">
 #include &lt;stdio.h&gt;
 #include &lt;string.h&gt;
@@ -59,6 +59,7 @@
 	doc = parseDoc (docname, uri);
 	if (doc != NULL) {
 		xmlSaveFormatFile (docname, doc, 1);
+		xmlFreeDoc(doc);
 	}
 	return (1);
 }
diff --git a/doc/tutorial/ape.html b/doc/tutorial/ape.html
index 9be15e8..669c7f2 100644
--- a/doc/tutorial/ape.html
+++ b/doc/tutorial/ape.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>E. Code for Retrieving Attribute Value Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apd.html" title="D. Code for Add Attribute Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">E. Code for Retrieving Attribute Value Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apd.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="getattributeappendix"></a>E. Code for Retrieving Attribute Value Example</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>E. Code for Retrieving Attribute Value Example</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="apd.html" title="D. Code for Add Attribute Example"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">E. Code for Retrieving Attribute Value Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apd.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix"><h2 class="title" style="clear: both"><a name="getattributeappendix"></a>E. Code for Retrieving Attribute Value Example</h2><p>
       <pre class="programlisting">
 #include &lt;stdio.h&gt;
 #include &lt;string.h&gt;
@@ -49,7 +49,7 @@
 	}
 	
 	getReference (doc, cur);
-
+	xmlFreeDoc(doc);
 	return;
 }
 
diff --git a/doc/tutorial/ar01s02.html b/doc/tutorial/ar01s02.html
index ba39021..b59d873 100644
--- a/doc/tutorial/ar01s02.html
+++ b/doc/tutorial/ar01s02.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Data Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="index.html" title="Libxml Tutorial"><link rel="next" href="ar01s03.html" title="Parsing the file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Data Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s03.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialdatatypes"></a>Data Types</h2></div></div><p>Libxml declares a number of datatypes we
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Data Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="index.html" title="Libxml Tutorial"><link rel="next" href="ar01s03.html" title="Parsing the file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Data Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s03.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialdatatypes"></a>Data Types</h2></div></div><p>Libxml declares a number of datatypes we
     will encounter repeatedly, hiding the messy stuff so you do not have to deal
     with it unless you have some specific need.</p><p>
       <div class="variablelist"><dl><dt><span class="term"><a href="http://xmlsoft.org/html/libxml-tree.html#XMLCHAR" target="_top">xmlChar</a></span></dt><dd><p>A basic replacement for char, a byte in a UTF-8 encoded
diff --git a/doc/tutorial/ar01s03.html b/doc/tutorial/ar01s03.html
index 62429fa..373f3ed 100644
--- a/doc/tutorial/ar01s03.html
+++ b/doc/tutorial/ar01s03.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Parsing the file</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s02.html" title="Data Types"><link rel="next" href="ar01s04.html" title="Retrieving Element Content"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Parsing the file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialparsing"></a>Parsing the file</h2></div></div><p>Parsing the file requires only the name of the file and a single
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Parsing the file</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s02.html" title="Data Types"><link rel="next" href="ar01s04.html" title="Retrieving Element Content"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Parsing the file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialparsing"></a>Parsing the file</h2></div></div><p>Parsing the file requires only the name of the file and a single
       function call, plus error checking. Full code: <a href="apb.html" title="B. Code for Keyword Example">Appendix B</a></p><p>
     <pre class="programlisting">
         <a name="declaredoc"></a><img src="images/callouts/1.png" alt="1" border="0"> xmlDocPtr doc;
diff --git a/doc/tutorial/ar01s04.html b/doc/tutorial/ar01s04.html
index 8a9867d..1d5a6db 100644
--- a/doc/tutorial/ar01s04.html
+++ b/doc/tutorial/ar01s04.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Retrieving Element Content</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s03.html" title="Parsing the file"><link rel="next" href="ar01s05.html" title="Writing element content"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Retrieving Element Content</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s05.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialgettext"></a>Retrieving Element Content</h2></div></div><p>Retrieving the content of an element involves traversing the document
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Retrieving Element Content</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s03.html" title="Parsing the file"><link rel="next" href="ar01s05.html" title="Writing element content"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Retrieving Element Content</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s05.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialgettext"></a>Retrieving Element Content</h2></div></div><p>Retrieving the content of an element involves traversing the document
     tree until you find what you are looking for. In this case, we are looking
     for an element called &quot;keyword&quot; contained within element called &quot;story&quot;. The
     process to find the node we are interested in involves tediously walking the
diff --git a/doc/tutorial/ar01s05.html b/doc/tutorial/ar01s05.html
index 5f90af8..a70ba9c 100644
--- a/doc/tutorial/ar01s05.html
+++ b/doc/tutorial/ar01s05.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Writing element content</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s04.html" title="Retrieving Element Content"><link rel="next" href="ar01s06.html" title="Writing Attribute"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing element content</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s06.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialwritingcontent"></a>Writing element content</h2></div></div><p>Writing element content uses many of the same steps we used above
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Writing element content</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s04.html" title="Retrieving Element Content"><link rel="next" href="ar01s06.html" title="Writing Attribute"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing element content</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s06.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialwritingcontent"></a>Writing element content</h2></div></div><p>Writing element content uses many of the same steps we used above
     &#8212; parsing the document and walking the tree. We parse the document,
     then traverse the tree to find the place we want to insert our element. For
     this example, we want to again find the &quot;storyinfo&quot; element and
diff --git a/doc/tutorial/ar01s06.html b/doc/tutorial/ar01s06.html
index 2bbd2df..be70cfa 100644
--- a/doc/tutorial/ar01s06.html
+++ b/doc/tutorial/ar01s06.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Writing Attribute</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s05.html" title="Writing element content"><link rel="next" href="ar01s07.html" title="Retrieving Attributes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing Attribute</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s05.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s07.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialwritingattribute"></a>Writing Attribute</h2></div></div><p>Writing an attribute is similar to writing text to a new element. In
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Writing Attribute</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s05.html" title="Writing element content"><link rel="next" href="ar01s07.html" title="Retrieving Attributes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Writing Attribute</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s05.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s07.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialwritingattribute"></a>Writing Attribute</h2></div></div><p>Writing an attribute is similar to writing text to a new element. In
       this case, we'll add a reference URI to our
       document. Full code:<a href="apd.html" title="D. Code for Add Attribute Example">Appendix D</a>.</p><p>
       A <tt class="sgmltag-element">reference</tt> is a child of the <tt class="sgmltag-element">story</tt>
diff --git a/doc/tutorial/ar01s07.html b/doc/tutorial/ar01s07.html
index 7dda324..39862f8 100644
--- a/doc/tutorial/ar01s07.html
+++ b/doc/tutorial/ar01s07.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Retrieving Attributes</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s06.html" title="Writing Attribute"><link rel="next" href="apa.html" title="A. Sample Document"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Retrieving Attributes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s06.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialattribute"></a>Retrieving Attributes</h2></div></div><p>Retrieving the value of an attribute is similar to the previous
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Retrieving Attributes</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="up" href="index.html" title="Libxml Tutorial"><link rel="previous" href="ar01s06.html" title="Writing Attribute"><link rel="next" href="apa.html" title="A. Sample Document"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Retrieving Attributes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s06.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="xmltutorialattribute"></a>Retrieving Attributes</h2></div></div><p>Retrieving the value of an attribute is similar to the previous
     example in which we retrieved a node's text contents. In this case we'll
       extract the value of the URI we added in the previous
       section. Full code: <a href="ape.html" title="E. Code for Retrieving Attribute Value Example">Appendix E</a>.</p><p>
diff --git a/doc/tutorial/images/callouts/1.png b/doc/tutorial/images/callouts/1.png
new file mode 100644
index 0000000..7d47343
--- /dev/null
+++ b/doc/tutorial/images/callouts/1.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/10.png b/doc/tutorial/images/callouts/10.png
new file mode 100644
index 0000000..997bbc8
--- /dev/null
+++ b/doc/tutorial/images/callouts/10.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/2.png b/doc/tutorial/images/callouts/2.png
new file mode 100644
index 0000000..5d09341
--- /dev/null
+++ b/doc/tutorial/images/callouts/2.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/3.png b/doc/tutorial/images/callouts/3.png
new file mode 100644
index 0000000..ef7b700
--- /dev/null
+++ b/doc/tutorial/images/callouts/3.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/4.png b/doc/tutorial/images/callouts/4.png
new file mode 100644
index 0000000..adb8364
--- /dev/null
+++ b/doc/tutorial/images/callouts/4.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/5.png b/doc/tutorial/images/callouts/5.png
new file mode 100644
index 0000000..4d7eb46
--- /dev/null
+++ b/doc/tutorial/images/callouts/5.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/6.png b/doc/tutorial/images/callouts/6.png
new file mode 100644
index 0000000..0ba694a
--- /dev/null
+++ b/doc/tutorial/images/callouts/6.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/7.png b/doc/tutorial/images/callouts/7.png
new file mode 100644
index 0000000..472e96f
--- /dev/null
+++ b/doc/tutorial/images/callouts/7.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/8.png b/doc/tutorial/images/callouts/8.png
new file mode 100644
index 0000000..5e60973
--- /dev/null
+++ b/doc/tutorial/images/callouts/8.png
Binary files differ
diff --git a/doc/tutorial/images/callouts/9.png b/doc/tutorial/images/callouts/9.png
new file mode 100644
index 0000000..a0676d2
--- /dev/null
+++ b/doc/tutorial/images/callouts/9.png
Binary files differ
diff --git a/doc/tutorial/includeaddattribute.c b/doc/tutorial/includeaddattribute.c
index 45321b3..bb6a18b 100644
--- a/doc/tutorial/includeaddattribute.c
+++ b/doc/tutorial/includeaddattribute.c
@@ -57,6 +57,7 @@
 	doc = parseDoc (docname, uri);
 	if (doc != NULL) {
 		xmlSaveFormatFile (docname, doc, 1);
+		xmlFreeDoc(doc);
 	}
 	return (1);
 }
diff --git a/doc/tutorial/includeaddkeyword.c b/doc/tutorial/includeaddkeyword.c
index 8f5de90..479b53b 100644
--- a/doc/tutorial/includeaddkeyword.c
+++ b/doc/tutorial/includeaddkeyword.c
@@ -22,6 +22,7 @@
 	
 	if (doc == NULL ) {
 		fprintf(stderr,"Document not parsed successfully. \n");
+		xmlFreeDoc(doc);
 		return (NULL);
 	}
 	
@@ -67,7 +68,9 @@
 	doc = parseDoc (docname, keyword);
 	if (doc != NULL) {
 		xmlSaveFormatFile (docname, doc, 0);
+		xmlFreeDoc(doc);
 	}
+	
 	return (1);
 }
 ]]>
diff --git a/doc/tutorial/includegetattribute.c b/doc/tutorial/includegetattribute.c
index f934667..17f5a2f 100644
--- a/doc/tutorial/includegetattribute.c
+++ b/doc/tutorial/includegetattribute.c
@@ -47,7 +47,7 @@
 	}
 	
 	getReference (doc, cur);
-
+	xmlFreeDoc(doc);
 	return;
 }
 
diff --git a/doc/tutorial/includekeyword.c b/doc/tutorial/includekeyword.c
index af2627d..fe234e6 100644
--- a/doc/tutorial/includekeyword.c
+++ b/doc/tutorial/includekeyword.c
@@ -53,7 +53,9 @@
 		 
 	cur = cur->next;
 	}
-       
+	
+	xmlFreeDoc(doc);
+	return;
 }
 
 int
diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html
index 3dee148..ca1a8d2 100644
--- a/doc/tutorial/index.html
+++ b/doc/tutorial/index.html
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Libxml Tutorial</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="next" href="ar01s02.html" title="Data Types"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Libxml Tutorial</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s02.html">Next</a></td></tr></table><hr></div><div class="article"><div class="titlepage"><div><h1 class="title"><a name="id2755382"></a>Libxml Tutorial</h1></div><div><h3 class="author">John Fleck</h3></div><div><p class="copyright">Copyright © 2002 John Fleck</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="2"><b>Revision History</b></th></tr><tr><td align="left">Revision 1</td><td align="left">June 4,2002</td></tr><tr><td align="left">Revision 2</td><td align="left">June 12, 2002</td></tr></table></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="index.html#introduction">Introduction</a></dt><dt><a href="ar01s02.html">Data Types</a></dt><dt><a href="ar01s03.html">Parsing the file</a></dt><dt><a href="ar01s04.html">Retrieving Element Content</a></dt><dt><a href="ar01s05.html">Writing element content</a></dt><dt><a href="ar01s06.html">Writing Attribute</a></dt><dt><a href="ar01s07.html">Retrieving Attributes</a></dt><dt>A. <a href="apa.html">Sample Document</a></dt><dt>B. <a href="apb.html">Code for Keyword Example</a></dt><dt>C. <a href="apc.html">Code for Add Keyword Example</a></dt><dt>D. <a href="apd.html">Code for Add Attribute Example</a></dt><dt>E. <a href="ape.html">Code for Retrieving Attribute Value Example</a></dt></dl></div><div class="abstract"><p><b>Abstract</b></p><p>Libxml is a freely licensed C language library for handling
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Libxml Tutorial</title><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="Libxml Tutorial"><link rel="next" href="ar01s02.html" title="Data Types"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Libxml Tutorial</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s02.html">Next</a></td></tr></table><hr></div><div class="article"><div class="titlepage"><div><h1 class="title"><a name="id2755940"></a>Libxml Tutorial</h1></div><div><h3 class="author">John Fleck</h3></div><div><p class="copyright">Copyright © 2002 John Fleck</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="2"><b>Revision History</b></th></tr><tr><td align="left">Revision 1</td><td align="left">June 4,2002</td></tr><tr><td align="left">Revision 2</td><td align="left">June 12, 2002</td></tr><tr><td align="left">Revision 3</td><td align="left">Aug. 31, 2002</td></tr></table></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="index.html#introduction">Introduction</a></dt><dt><a href="ar01s02.html">Data Types</a></dt><dt><a href="ar01s03.html">Parsing the file</a></dt><dt><a href="ar01s04.html">Retrieving Element Content</a></dt><dt><a href="ar01s05.html">Writing element content</a></dt><dt><a href="ar01s06.html">Writing Attribute</a></dt><dt><a href="ar01s07.html">Retrieving Attributes</a></dt><dt>A. <a href="apa.html">Sample Document</a></dt><dt>B. <a href="apb.html">Code for Keyword Example</a></dt><dt>C. <a href="apc.html">Code for Add Keyword Example</a></dt><dt>D. <a href="apd.html">Code for Add Attribute Example</a></dt><dt>E. <a href="ape.html">Code for Retrieving Attribute Value Example</a></dt></dl></div><div class="abstract"><p><b>Abstract</b></p><p>Libxml is a freely licensed C language library for handling
     XML, portable across a large number of platforms. This
     tutorial provides examples of its basic functions.</p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction</h2></div></div><p>Libxml is a C language library implementing functions for reading,
       creating and manipulating XML data. This tutorial
diff --git a/doc/tutorial/xmltutorial.xml b/doc/tutorial/xmltutorial.xml
index e73ec3a..18ebaf5 100644
--- a/doc/tutorial/xmltutorial.xml
+++ b/doc/tutorial/xmltutorial.xml
@@ -27,6 +27,10 @@
 	<revnumber>2</revnumber>
 	<date>June 12, 2002</date>
       </revision>
+      <revision>
+	<revnumber>3</revnumber>
+	<date>Aug. 31, 2002</date>
+      </revision>
     </revhistory>
   </articleinfo>
   <abstract>