Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 21 lines (18 sloc) 0.656 kB
941fae3 Fix compiler warnings and errors.
giggls authored
1 /* This software is placed by in the public domain by its authors. */
2 /* Written by Nic Roets. */
3
4 #include <stdio.h>
5 #include <unistd.h>
6 #include <libxml/xmlreader.h>
7
8 int main (void)
9 {
10 xmlTextReaderPtr xml = xmlReaderForFd (STDIN_FILENO, "", NULL, 0);
11 while (xmlTextReaderRead (xml)) {
12 char *name = (char *) BAD_CAST xmlTextReaderName (xml);
13 if (xmlTextReaderNodeType (xml) == XML_READER_TYPE_ELEMENT &&
14 strcasecmp (name, "text") == 0) {
15 while (xmlTextReaderRead (xml) && // memory leak :
16 xmlStrcmp (xmlTextReaderName (xml), BAD_CAST "#text") != 0) {}
17 printf ("%s\n", xmlTextReaderValue (xml));
18 }
19 }
20 }
Something went wrong with that request. Please try again.