diff --git a/ChangeLog b/ChangeLog index f6405458..ce29a5fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Sat Aug 31 19:31:17 MDT 2002 John Fleck + + * 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 * doc/Libxml2-Logo-180x168.gif doc/Libxml2-Logo-90x34.gif: diff --git a/doc/tutorial/apa.html b/doc/tutorial/apa.html index 375fb695..525dd318 100644 --- a/doc/tutorial/apa.html +++ b/doc/tutorial/apa.html @@ -1,5 +1,5 @@ -A. Sample Document

A. Sample Document

+A. Sample Document

A. Sample Document

 <?xml version="1.0"?>
 <story>
   <storyinfo>
diff --git a/doc/tutorial/apb.html b/doc/tutorial/apb.html
index e3b119ff..37835d6f 100644
--- a/doc/tutorial/apb.html
+++ b/doc/tutorial/apb.html
@@ -1,5 +1,5 @@
 
-B. Code for Keyword Example

B. Code for Keyword Example

+B. Code for Keyword Example

B. Code for Keyword Example

 #include <stdio.h>
 #include <string.h>
@@ -55,7 +55,9 @@ parseDoc(char *docname) {
 		 
 	cur = cur->next;
 	}
-       
+	
+	xmlFreeDoc(doc);
+	return;
 }
 
 int
diff --git a/doc/tutorial/apc.html b/doc/tutorial/apc.html
index 62ca6b28..37d5289b 100644
--- a/doc/tutorial/apc.html
+++ b/doc/tutorial/apc.html
@@ -1,5 +1,5 @@
 
-C. Code for Add Keyword Example

C. Code for Add Keyword Example

+C. Code for Add Keyword Example

C. Code for Add Keyword Example

 #include <stdio.h>
 #include <string.h>
@@ -24,6 +24,7 @@ parseDoc(char *docname, char *keyword) {
 	
 	if (doc == NULL ) {
 		fprintf(stderr,"Document not parsed successfully. \n");
+		xmlFreeDoc(doc);
 		return (NULL);
 	}
 	
@@ -69,7 +70,9 @@ main(int argc, char **argv) {
 	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 5e56f3c5..3425c865 100644
--- a/doc/tutorial/apd.html
+++ b/doc/tutorial/apd.html
@@ -1,5 +1,5 @@
 
-D. Code for Add Attribute Example

D. Code for Add Attribute Example

+D. Code for Add Attribute Example

D. Code for Add Attribute Example

 #include <stdio.h>
 #include <string.h>
@@ -59,6 +59,7 @@ main(int argc, char **argv) {
 	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 9be15e85..669c7f2d 100644
--- a/doc/tutorial/ape.html
+++ b/doc/tutorial/ape.html
@@ -1,5 +1,5 @@
 
-E. Code for Retrieving Attribute Value Example

E. Code for Retrieving Attribute Value Example

+E. Code for Retrieving Attribute Value Example

E. Code for Retrieving Attribute Value Example

 #include <stdio.h>
 #include <string.h>
@@ -49,7 +49,7 @@ parseDoc(char *docname) {
 	}
 	
 	getReference (doc, cur);
-
+	xmlFreeDoc(doc);
 	return;
 }
 
diff --git a/doc/tutorial/ar01s02.html b/doc/tutorial/ar01s02.html
index ba390211..b59d8738 100644
--- a/doc/tutorial/ar01s02.html
+++ b/doc/tutorial/ar01s02.html
@@ -1,5 +1,5 @@
 
-Data Types

Data Types

Libxml declares a number of datatypes we +Data Types

Data Types

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.

xmlChar

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 62429fa1..373f3ed3 100644 --- a/doc/tutorial/ar01s03.html +++ b/doc/tutorial/ar01s03.html @@ -1,5 +1,5 @@ -Parsing the file

Parsing the file

Parsing the file requires only the name of the file and a single +Parsing the file

Parsing the file

Parsing the file requires only the name of the file and a single function call, plus error checking. Full code: Appendix B

         1 xmlDocPtr doc;
diff --git a/doc/tutorial/ar01s04.html b/doc/tutorial/ar01s04.html
index 8a9867d0..1d5a6db7 100644
--- a/doc/tutorial/ar01s04.html
+++ b/doc/tutorial/ar01s04.html
@@ -1,5 +1,5 @@
 
-Retrieving Element Content

Retrieving Element Content

Retrieving the content of an element involves traversing the document +Retrieving Element Content

Retrieving Element Content

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 "keyword" contained within element called "story". 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 5f90af87..a70ba9c9 100644 --- a/doc/tutorial/ar01s05.html +++ b/doc/tutorial/ar01s05.html @@ -1,5 +1,5 @@ -Writing element content

Writing element content

Writing element content uses many of the same steps we used above +Writing element content

Writing element content

Writing element content uses many of the same steps we used above — 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 "storyinfo" element and diff --git a/doc/tutorial/ar01s06.html b/doc/tutorial/ar01s06.html index 2bbd2dfa..be70cfa0 100644 --- a/doc/tutorial/ar01s06.html +++ b/doc/tutorial/ar01s06.html @@ -1,5 +1,5 @@ -Writing Attribute

Writing Attribute

Writing an attribute is similar to writing text to a new element. In +Writing Attribute

Writing Attribute

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:Appendix D.

A reference is a child of the story diff --git a/doc/tutorial/ar01s07.html b/doc/tutorial/ar01s07.html index 7dda324c..39862f8c 100644 --- a/doc/tutorial/ar01s07.html +++ b/doc/tutorial/ar01s07.html @@ -1,5 +1,5 @@ -Retrieving Attributes

Retrieving Attributes

Retrieving the value of an attribute is similar to the previous +Retrieving Attributes

Retrieving Attributes

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: Appendix E.

diff --git a/doc/tutorial/images/callouts/1.png b/doc/tutorial/images/callouts/1.png new file mode 100644 index 00000000..7d473430 Binary files /dev/null and b/doc/tutorial/images/callouts/1.png differ diff --git a/doc/tutorial/images/callouts/10.png b/doc/tutorial/images/callouts/10.png new file mode 100644 index 00000000..997bbc82 Binary files /dev/null and b/doc/tutorial/images/callouts/10.png differ diff --git a/doc/tutorial/images/callouts/2.png b/doc/tutorial/images/callouts/2.png new file mode 100644 index 00000000..5d09341b Binary files /dev/null and b/doc/tutorial/images/callouts/2.png differ diff --git a/doc/tutorial/images/callouts/3.png b/doc/tutorial/images/callouts/3.png new file mode 100644 index 00000000..ef7b7004 Binary files /dev/null and b/doc/tutorial/images/callouts/3.png differ diff --git a/doc/tutorial/images/callouts/4.png b/doc/tutorial/images/callouts/4.png new file mode 100644 index 00000000..adb8364e Binary files /dev/null and b/doc/tutorial/images/callouts/4.png differ diff --git a/doc/tutorial/images/callouts/5.png b/doc/tutorial/images/callouts/5.png new file mode 100644 index 00000000..4d7eb460 Binary files /dev/null and b/doc/tutorial/images/callouts/5.png differ diff --git a/doc/tutorial/images/callouts/6.png b/doc/tutorial/images/callouts/6.png new file mode 100644 index 00000000..0ba694af Binary files /dev/null and b/doc/tutorial/images/callouts/6.png differ diff --git a/doc/tutorial/images/callouts/7.png b/doc/tutorial/images/callouts/7.png new file mode 100644 index 00000000..472e96f8 Binary files /dev/null and b/doc/tutorial/images/callouts/7.png differ diff --git a/doc/tutorial/images/callouts/8.png b/doc/tutorial/images/callouts/8.png new file mode 100644 index 00000000..5e60973c Binary files /dev/null and b/doc/tutorial/images/callouts/8.png differ diff --git a/doc/tutorial/images/callouts/9.png b/doc/tutorial/images/callouts/9.png new file mode 100644 index 00000000..a0676d26 Binary files /dev/null and b/doc/tutorial/images/callouts/9.png differ diff --git a/doc/tutorial/includeaddattribute.c b/doc/tutorial/includeaddattribute.c index 45321b3f..bb6a18b4 100644 --- a/doc/tutorial/includeaddattribute.c +++ b/doc/tutorial/includeaddattribute.c @@ -57,6 +57,7 @@ main(int argc, char **argv) { 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 8f5de904..479b53b4 100644 --- a/doc/tutorial/includeaddkeyword.c +++ b/doc/tutorial/includeaddkeyword.c @@ -22,6 +22,7 @@ parseDoc(char *docname, char *keyword) { if (doc == NULL ) { fprintf(stderr,"Document not parsed successfully. \n"); + xmlFreeDoc(doc); return (NULL); } @@ -67,7 +68,9 @@ main(int argc, char **argv) { 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 f934667e..17f5a2f4 100644 --- a/doc/tutorial/includegetattribute.c +++ b/doc/tutorial/includegetattribute.c @@ -47,7 +47,7 @@ parseDoc(char *docname) { } getReference (doc, cur); - + xmlFreeDoc(doc); return; } diff --git a/doc/tutorial/includekeyword.c b/doc/tutorial/includekeyword.c index af2627d4..fe234e6a 100644 --- a/doc/tutorial/includekeyword.c +++ b/doc/tutorial/includekeyword.c @@ -53,7 +53,9 @@ parseDoc(char *docname) { cur = cur->next; } - + + xmlFreeDoc(doc); + return; } int diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html index 3dee1480..ca1a8d2f 100644 --- a/doc/tutorial/index.html +++ b/doc/tutorial/index.html @@ -1,5 +1,5 @@ -Libxml Tutorial

Libxml Tutorial

John Fleck

Revision History
Revision 1June 4,2002
Revision 2June 12, 2002

Abstract

Libxml is a freely licensed C language library for handling +Libxml Tutorial

Libxml Tutorial

John Fleck

Revision History
Revision 1June 4,2002
Revision 2June 12, 2002
Revision 3Aug. 31, 2002

Abstract

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.

Introduction

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 e73ec3a4..18ebaf5d 100644 --- a/doc/tutorial/xmltutorial.xml +++ b/doc/tutorial/xmltutorial.xml @@ -27,6 +27,10 @@ 2 June 12, 2002 + + 3 + Aug. 31, 2002 +