1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

doc/tutorial/xmltutorial.xml doc/tutorial/includekeyword.c

Sun Dec 15 21:27:30 MST 2002 John Fleck <jfleck@inkstain.net>

	* doc/tutorial/xmltutorial.xml
	* doc/tutorial/includekeyword.c
	* doc/tutorial/includegetattribute.c
	plus generated html and pdf
	Adding fix from Niraj Tolia to tutorial to properly free memory.
This commit is contained in:
MST 2002 John Fleck
2002-12-16 04:34:57 +00:00
committed by John Fleck
parent da46d2d31e
commit 44aacb3404
12 changed files with 57 additions and 27 deletions

View File

@ -8,11 +8,14 @@
void
parseStory (xmlDocPtr doc, xmlNodePtr cur) {
xmlChar *key;
cur = cur->xmlChildrenNode;
while (cur != NULL) {
if ((!xmlStrcmp(cur->name, (const xmlChar *)"keyword"))) {
printf("keyword: %s\n", xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
}
key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
printf("keyword: %s\n", key);
xmlFree(key);
}
cur = cur->next;
}
return;
@ -28,7 +31,6 @@ parseDoc(char *docname) {
if (doc == NULL ) {
fprintf(stderr,"Document not parsed successfully. \n");
xmlFreeDoc(doc);
return;
}