From 77e4d358c68aeabdae9ddeba84e7f511e730a764 Mon Sep 17 00:00:00 2001 From: MDT 2002 John Fleck Date: Sun, 1 Sep 2002 01:37:11 +0000 Subject: [PATCH] doc/tutorial/includeaddattribute.c doc/tutorial/includeaddkeyword.c 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) --- ChangeLog | 15 +++++++++++++++ doc/tutorial/apa.html | 2 +- doc/tutorial/apb.html | 6 ++++-- doc/tutorial/apc.html | 5 ++++- doc/tutorial/apd.html | 3 ++- doc/tutorial/ape.html | 4 ++-- doc/tutorial/ar01s02.html | 2 +- doc/tutorial/ar01s03.html | 2 +- doc/tutorial/ar01s04.html | 2 +- doc/tutorial/ar01s05.html | 2 +- doc/tutorial/ar01s06.html | 2 +- doc/tutorial/ar01s07.html | 2 +- doc/tutorial/images/callouts/1.png | Bin 0 -> 329 bytes doc/tutorial/images/callouts/10.png | Bin 0 -> 361 bytes doc/tutorial/images/callouts/2.png | Bin 0 -> 353 bytes doc/tutorial/images/callouts/3.png | Bin 0 -> 350 bytes doc/tutorial/images/callouts/4.png | Bin 0 -> 345 bytes doc/tutorial/images/callouts/5.png | Bin 0 -> 348 bytes doc/tutorial/images/callouts/6.png | Bin 0 -> 355 bytes doc/tutorial/images/callouts/7.png | Bin 0 -> 344 bytes doc/tutorial/images/callouts/8.png | Bin 0 -> 357 bytes doc/tutorial/images/callouts/9.png | Bin 0 -> 357 bytes doc/tutorial/includeaddattribute.c | 1 + doc/tutorial/includeaddkeyword.c | 3 +++ doc/tutorial/includegetattribute.c | 2 +- doc/tutorial/includekeyword.c | 4 +++- doc/tutorial/index.html | 2 +- doc/tutorial/xmltutorial.xml | 4 ++++ 28 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 doc/tutorial/images/callouts/1.png create mode 100644 doc/tutorial/images/callouts/10.png create mode 100644 doc/tutorial/images/callouts/2.png create mode 100644 doc/tutorial/images/callouts/3.png create mode 100644 doc/tutorial/images/callouts/4.png create mode 100644 doc/tutorial/images/callouts/5.png create mode 100644 doc/tutorial/images/callouts/6.png create mode 100644 doc/tutorial/images/callouts/7.png create mode 100644 doc/tutorial/images/callouts/8.png create mode 100644 doc/tutorial/images/callouts/9.png 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 0000000000000000000000000000000000000000..7d473430b7bec514f7de12f5769fe7c5859e8c5d GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQC}X^4DKU-G|w_t}fLBA)Suv#nrW z!^h2QnY_`l!BOq-UXEX{m2up>JTQkX)2m zTvF+fTUlI^nXH#utd~++ke^qgmzgTe~DWM4ffP81J literal 0 HcmV?d00001 diff --git a/doc/tutorial/images/callouts/10.png b/doc/tutorial/images/callouts/10.png new file mode 100644 index 0000000000000000000000000000000000000000..997bbc8246a316e040e0804174ba260e219d7d33 GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQWtZ~+OvdJMW|Y+^UT?O-M{rKJsmzxdayJ{ zDCQA!%%@7Jj$q%-wf8e0_jRx8Dqi$}^?K=?6FriQFLv>>oc^CE+aVHhW3=nZ+fQ4!M=ZC7H>3sl|FJr3LwU zC3?yExf6FO?f@F61vV}-Juk7O6lk8Yg;}bFaZ-|HQc7Azopr01?u8M*si- literal 0 HcmV?d00001 diff --git a/doc/tutorial/images/callouts/2.png b/doc/tutorial/images/callouts/2.png new file mode 100644 index 0000000000000000000000000000000000000000..5d09341b2f6d2ea2d1d5dad5d980f14b4b05dfd2 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQxaY7e*=hH)_rZeB4|imU1$R#1`!P>&$poQl;nzm}mD5ZFopaX|GsS%q*{P~< z;WtmO%lhToBL0i}yfkaOt?EN=nkLNGuU`ywhI5H)L`iUdT1k0gQ7VIjhO(w-Zen_> zZ(@38a<+nro{^q~f~BRtfrY+-p+a&|W^qZSLvCepNoKNMYO!8QX+eHoiC%Jk?!;Y+ zJAlS%fsM;d&r2*R1)67JkeZlkYGj#gX_9E3W@4U_nw*@Ln38B@k(iuhnUeN2eF0kK0(Y1u|9Rc(19XFPiEBhjaDG}zd16s2gM)^$re|(qda7?? zdS-IAf{C7yo`r&?rM`iMzJZ}aa#3b+Nu@(>WpPPnvR-PjUP@^}eqM=Qa(?c_U5Yz^ z#%Y0#%S_KpEGY$=XJL?(l#*ybuErX#^g`ttQfwn3r>K)tuC)r#2`iJ>Prt42#Ndx#Uc~1)>aw z3jE@Q4|!9Z%lVv}- zc=48cF7H)t`(Ck`^+mtha~Np7bBSw2NpOBzNqJ&XDuaWDvZiNlVtT4?VtQtBwt|VC zk)DNurKP@sg}#BILUK`NaY>~^Ze?*vX0l#tv0h4PL4IC|UUGi!#9fLzfW~Qojmu2W zODrh`nrE42VU(7fm~5G9U~HM3l#*m_WNcxOXkuzEX4g z+-vfUhb0A>b04=Im{6XiQd1v%r%>h0$G8U7E1If8OQ!N~xOYY5h0NDT$p9(iZ?Q&e z18-(+l~J8O`)kc}e&uL$eW&>P-#`~Qm$*ih1m~xflqVLYGB{``YkKA;rl!p+yCFkc(+@-h!Xq*<< zxXkpt#FA2=d1VEBsYynrsitN|Y01eJ$;p;U#>wWX2KP5v&I9V=1L+C? fTFYQ)RAFeOZJ=$?lDoSWD8u0C>gTe~DWM4f^}upZ literal 0 HcmV?d00001 diff --git a/doc/tutorial/images/callouts/6.png b/doc/tutorial/images/callouts/6.png new file mode 100644 index 0000000000000000000000000000000000000000..0ba694af6c07d947d219b45a629bd32c60a0f5fe GIT binary patch literal 355 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ*)Bra@SU# zmiz#bR~{$s2si{S(aY|Z}Vd7tb ouUmn-_&~Y>fYve?8dVq?X&Y!8wB+ut1u%w%U~xZhnMEEs6JbBSw2NpOBzNqJ&XDuaWDvZiNlVtT4?VtQtBwt|VC zk)DNurKP@sg}#BILUK`NaY>~^Ze?*vX0l#tv0h4PL4IC|UUGi!#9fLzfW~Qojmu2W zODrh`nrCEbVQgk$XkwI@Y+{_8nv`N>YGIaQkz#0QY@Te9lBQ<)awbq0A4pdK&{_sV bqY6VKZ3AtCmfYR7Kp6&4S3j3^P6u&S`V$cAh@R~F=4@V4jxkzlaQrcFYWK{)(`o5XZnut z=nE4SU2g1ZW%;@@I$>_e3F8a=8WK~|CVXt1DqisQxtIX|`YW_n&?Nh#1gQ}d)$LrYTw(_{nVG)tp2V+#}WG*e^KRLdkoLz7g? qn(IA84Qgo42`r6v<+Hvch>@C7(8A5T-G@yGywn*$#_oy literal 0 HcmV?d00001 diff --git a/doc/tutorial/images/callouts/9.png b/doc/tutorial/images/callouts/9.png new file mode 100644 index 0000000000000000000000000000000000000000..a0676d26cc2ff1de12c4ecdeefb44a0d71bc6bde GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQNRqa;^5&H%t0&v*|C|wdb9$wI zR@+N9#RIowg@Uqn&z-__Tzhhz!sG|vTxA7?=O|Y?u(d4T{!RM9c7chr6d%1?R=i16 z?@Ic{f32YJFJnVhX)qGzOMplv!L->5yAlT#}irms+fsQd*FoSE84k zpF44v;trs3T43Wc)AJHbN`dAXo0u6Hr<$gkq?lM38ycjV7+5A5Sr{ayr5c%-n;95g pF*H#D>f!_G3IJNmU}#ifXryhRZP1dtyA~+J;OXk;vd$@?2>@J{cB%jX literal 0 HcmV?d00001 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 +